Class WriterController

java.lang.Object
kieker.monitoring.core.controller.AbstractController
kieker.monitoring.core.controller.WriterController
All Implemented Interfaces:
kieker.common.registry.IMonitoringRecordReceiver, IWriterController

public final class WriterController
extends AbstractController
implements IWriterController
Since:
1.3
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.lang.String PREFIX  
    static java.lang.String QUEUE_PUT_STRATEGY
    The fully qualified name of the put strategy
    static java.lang.String QUEUE_TAKE_STRATEGY
    The fully qualified name of the take strategy
    static java.lang.String RECORD_QUEUE_FQN
    The fully qualified name of the queue to be used for the records.
    static java.lang.String RECORD_QUEUE_INSERT_BEHAVIOR
    The name of the configuration determining the insert behavior to the queue of the writer.
    static java.lang.String RECORD_QUEUE_SIZE
    The name of the configuration determining the size of the queue of this writer.

    Fields inherited from class kieker.monitoring.core.controller.AbstractController

    monitoringController
  • Constructor Summary

    Constructors 
    Constructor Description
    WriterController​(kieker.common.configuration.Configuration configuration)
    Creates a new instance of this class using the given parameters.
  • Method Summary

    Modifier and Type Method Description
    protected void cleanup()
    This method should clean up.
    protected void init()
    This method should to the initialization work.
    boolean newMonitoringRecord​(kieker.common.record.IMonitoringRecord record)
    Called for each new record to write it out to the pre-configured target (e.g., file system, database, or messaging queue).
    java.lang.String toString()  
    void waitForTermination​(long timeoutInMs)
    Waits for the termination of the monitoring controller.

    Methods inherited from class kieker.monitoring.core.controller.AbstractController

    createAndInitialize, isTerminated, setMonitoringController, terminate

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • WriterController

      public WriterController​(kieker.common.configuration.Configuration configuration)
      Creates a new instance of this class using the given parameters.
      Parameters:
      configuration - The configuration for the controller.
  • Method Details

    • init

      protected void init()
      Description copied from class: AbstractController
      This method should to the initialization work.
      Specified by:
      init in class AbstractController
    • cleanup

      protected void cleanup()
      Description copied from class: AbstractController
      This method should clean up.
      Specified by:
      cleanup in class AbstractController
    • toString

      public java.lang.String toString()
      Specified by:
      toString in class AbstractController
    • newMonitoringRecord

      public boolean newMonitoringRecord​(kieker.common.record.IMonitoringRecord record)
      Description copied from interface: IWriterController

      Called for each new record to write it out to the pre-configured target (e.g., file system, database, or messaging queue). This method could invoke the given record's methods declared in IMonitoringRecord and thus alter its loggingTimestamp property.

      Notice, that this method should not throw an exception, but indicate an error by the return value false.

      Specified by:
      newMonitoringRecord in interface kieker.common.registry.IMonitoringRecordReceiver
      Specified by:
      newMonitoringRecord in interface IWriterController
      Parameters:
      record - the record.
      Returns:
      true on success; false in case of an error.
    • waitForTermination

      public void waitForTermination​(long timeoutInMs) throws java.lang.InterruptedException
      Description copied from interface: IWriterController
      Waits for the termination of the monitoring controller. The termination must be previously triggered by MonitoringController.terminateMonitoring().
      Specified by:
      waitForTermination in interface IWriterController
      Parameters:
      timeoutInMs - timeout in milliseconds to wait (a timeout of 0 means to wait forever)
      Throws:
      java.lang.InterruptedException - if the calling thread was interrupted while waiting for the termination