Class WriterController
java.lang.Object
kieker.monitoring.core.controller.AbstractController
kieker.monitoring.core.controller.WriterController
- All Implemented Interfaces:
IMonitoringRecordReceiver,IWriterController
public final class WriterController extends AbstractController implements IWriterController
- Since:
- 1.3
- Author:
- Andre van Hoorn, Matthias Rohr, Jan Waller, Robert von Massow
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPREFIXstatic java.lang.StringQUEUE_PUT_STRATEGYThe fully qualified name of the put strategystatic java.lang.StringQUEUE_TAKE_STRATEGYThe fully qualified name of the take strategystatic java.lang.StringRECORD_QUEUE_FQNThe fully qualified name of the queue to be used for the records.static java.lang.StringRECORD_QUEUE_INSERT_BEHAVIORThe name of the configuration determining the insert behavior to the queue of the writer.static java.lang.StringRECORD_QUEUE_SIZEThe 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(Configuration configuration)Creates a new instance of this class using the given parameters. -
Method Summary
Modifier and Type Method Description protected voidcleanup()This method should clean up.protected voidinit()This method should to the initialization work.booleannewMonitoringRecord(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.StringtoString()voidwaitForTermination(long timeoutInMs)Waits for the termination of the monitoring controller.Methods inherited from class kieker.monitoring.core.controller.AbstractController
createAndInitialize, isTerminated, setMonitoringController, terminate
-
Field Details
-
PREFIX
public static final java.lang.String PREFIX -
RECORD_QUEUE_SIZE
public static final java.lang.String RECORD_QUEUE_SIZEThe name of the configuration determining the size of the queue of this writer.- See Also:
- Constant Field Values
-
RECORD_QUEUE_INSERT_BEHAVIOR
public static final java.lang.String RECORD_QUEUE_INSERT_BEHAVIORThe name of the configuration determining the insert behavior to the queue of the writer.- See Also:
- Constant Field Values
-
RECORD_QUEUE_FQN
public static final java.lang.String RECORD_QUEUE_FQNThe fully qualified name of the queue to be used for the records.- See Also:
- Constant Field Values
-
QUEUE_PUT_STRATEGY
public static final java.lang.String QUEUE_PUT_STRATEGYThe fully qualified name of the put strategy- See Also:
- Constant Field Values
-
QUEUE_TAKE_STRATEGY
public static final java.lang.String QUEUE_TAKE_STRATEGYThe fully qualified name of the take strategy- See Also:
- Constant Field Values
-
-
Constructor Details
-
WriterController
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:AbstractControllerThis method should to the initialization work.- Specified by:
initin classAbstractController
-
cleanup
protected void cleanup()Description copied from class:AbstractControllerThis method should clean up.- Specified by:
cleanupin classAbstractController
-
toString
public java.lang.String toString()- Specified by:
toStringin classAbstractController
-
newMonitoringRecord
Description copied from interface:IWriterControllerCalled 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 inIMonitoringRecordand thus alter itsloggingTimestampproperty.Notice, that this method should not throw an exception, but indicate an error by the return value false.
- Specified by:
newMonitoringRecordin interfaceIMonitoringRecordReceiver- Specified by:
newMonitoringRecordin interfaceIWriterController- Parameters:
record- the record.- Returns:
- true on success; false in case of an error.
-
waitForTermination
public void waitForTermination(long timeoutInMs) throws java.lang.InterruptedExceptionDescription copied from interface:IWriterControllerWaits for the termination of the monitoring controller. The termination must be previously triggered byMonitoringController.terminateMonitoring().- Specified by:
waitForTerminationin interfaceIWriterController- 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
-