public final class WriterController extends AbstractController implements IWriterController
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PREFIX |
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.
|
monitoringController
Constructor and Description |
---|
WriterController(Configuration configuration)
Creates a new instance of this class using the given parameters.
|
Modifier and Type | Method and 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.
|
createAndInitialize, isTerminated, setMonitoringController, terminate
public static final java.lang.String PREFIX
public static final java.lang.String RECORD_QUEUE_SIZE
public static final java.lang.String RECORD_QUEUE_INSERT_BEHAVIOR
public static final java.lang.String RECORD_QUEUE_FQN
public WriterController(Configuration configuration)
configuration
- The configuration for the controller.protected final void init()
AbstractController
init
in class AbstractController
protected final void cleanup()
AbstractController
cleanup
in class AbstractController
public final java.lang.String toString()
toString
in class AbstractController
public final boolean newMonitoringRecord(IMonitoringRecord record)
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.
newMonitoringRecord
in interface IMonitoringRecordReceiver
newMonitoringRecord
in interface IWriterController
record
- the record.public void waitForTermination(long timeoutInMs) throws java.lang.InterruptedException
IWriterController
MonitoringController.terminateMonitoring()
.waitForTermination
in interface IWriterController
timeoutInMs
- timeout in milliseconds to wait (a timeout of 0 means to wait forever)java.lang.InterruptedException
- if the calling thread was interrupted while waiting for the terminationCopyright 2017 Kieker Project, http://kieker-monitoring.net