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.String
PREFIX
static java.lang.String
QUEUE_PUT_STRATEGY
The fully qualified name of the put strategystatic java.lang.String
QUEUE_TAKE_STRATEGY
The fully qualified name of the take strategystatic 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(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(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
-
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:AbstractController
This method should to the initialization work.- Specified by:
init
in classAbstractController
-
cleanup
protected void cleanup()Description copied from class:AbstractController
This method should clean up.- Specified by:
cleanup
in classAbstractController
-
toString
public java.lang.String toString()- Specified by:
toString
in classAbstractController
-
newMonitoringRecord
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 inIMonitoringRecord
and thus alter itsloggingTimestamp
property.Notice, that this method should not throw an exception, but indicate an error by the return value false.
- Specified by:
newMonitoringRecord
in interfaceIMonitoringRecordReceiver
- Specified by:
newMonitoringRecord
in 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:IWriterController
Waits for the termination of the monitoring controller. The termination must be previously triggered byMonitoringController.terminateMonitoring()
.- Specified by:
waitForTermination
in 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
-