Kieker 1.12

kieker.monitoring.writer
Class AbstractAsyncWriter

java.lang.Object
  extended by kieker.monitoring.writer.AbstractMonitoringWriter
      extended by kieker.monitoring.writer.AbstractAsyncWriter
All Implemented Interfaces:
IMonitoringRecordReceiver, IMonitoringWriter
Direct Known Subclasses:
AbstractAsyncFSWriter, AbstractAsyncZipWriter, AMQPWriter, AsyncDbWriter, AsyncDummyWriter, AsyncJMSWriter, ExplorVizExportWriter, TCPWriter

public abstract class AbstractAsyncWriter
extends AbstractMonitoringWriter

Since:
1.3
Author:
Jan Waller

Field Summary
protected  java.util.concurrent.BlockingQueue<IMonitoringRecord> blockingQueue
          The queue containing the records to be written.
static java.lang.String CONFIG_BEHAVIOR
          The name of the configuration determining the behavior of this writer in case of a full queue.
static java.lang.String CONFIG_PRIORITIZED_QUEUESIZE
          The name of the configuration determining the size of the prioritized queue of this writer.
static java.lang.String CONFIG_QUEUESIZE
          The name of the configuration determining the size of the queue of this writer.
static java.lang.String CONFIG_SHUTDOWNDELAY
          The name of the configuration determining the maximal shutdown delay of this writer (in milliseconds).
protected  java.util.concurrent.BlockingQueue<IMonitoringRecord> prioritizedBlockingQueue
          The queue containing prioritized records (mostly RegistryRecord) to be written.
 
Fields inherited from class kieker.monitoring.writer.AbstractMonitoringWriter
monitoringController
 
Constructor Summary
protected AbstractAsyncWriter(Configuration configuration)
          This constructor initializes the writer based on the given configuration.
 
Method Summary
protected  void addWorker(AbstractAsyncThread worker)
          This method must be called at the end of the child constructor!
protected  Configuration getDefaultConfiguration()
          This method should be overwritten, iff the writer is external to Kieker and thus its default configuration is not included in the default config file.
 boolean newMonitoringRecord(IMonitoringRecord monitoringRecord)
          Called for each new record.
 boolean newMonitoringRecordNonBlocking(IMonitoringRecord monitoringRecord)
          Overwrite this method if necessary.
 void terminate()
          The framework ensures, that this method is called only once!
 java.lang.String toString()
          Delivers a string representation of this writer.
 
Methods inherited from class kieker.monitoring.writer.AbstractMonitoringWriter
init, setController
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONFIG_QUEUESIZE

public static final java.lang.String CONFIG_QUEUESIZE
The name of the configuration determining the size of the queue of this writer.

See Also:
Constant Field Values

CONFIG_PRIORITIZED_QUEUESIZE

public static final java.lang.String CONFIG_PRIORITIZED_QUEUESIZE
The name of the configuration determining the size of the prioritized queue of this writer.

See Also:
Constant Field Values

CONFIG_BEHAVIOR

public static final java.lang.String CONFIG_BEHAVIOR
The name of the configuration determining the behavior of this writer in case of a full queue.

See Also:
Constant Field Values

CONFIG_SHUTDOWNDELAY

public static final java.lang.String CONFIG_SHUTDOWNDELAY
The name of the configuration determining the maximal shutdown delay of this writer (in milliseconds).

See Also:
Constant Field Values

blockingQueue

protected final java.util.concurrent.BlockingQueue<IMonitoringRecord> blockingQueue
The queue containing the records to be written.


prioritizedBlockingQueue

protected final java.util.concurrent.BlockingQueue<IMonitoringRecord> prioritizedBlockingQueue
The queue containing prioritized records (mostly RegistryRecord) to be written.

Constructor Detail

AbstractAsyncWriter

protected AbstractAsyncWriter(Configuration configuration)
This constructor initializes the writer based on the given configuration.

Parameters:
configuration - The configuration for this writer.
Method Detail

getDefaultConfiguration

protected Configuration getDefaultConfiguration()
This method should be overwritten, iff the writer is external to Kieker and thus its default configuration is not included in the default config file. Make sure that the three required properties always have default values!

Overrides:
getDefaultConfiguration in class AbstractMonitoringWriter
Returns:
The configuration object containing the default configuration.

addWorker

protected final void addWorker(AbstractAsyncThread worker)
This method must be called at the end of the child constructor!

Parameters:
worker - The new worker.

terminate

public final void terminate()
The framework ensures, that this method is called only once!


newMonitoringRecord

public final boolean newMonitoringRecord(IMonitoringRecord monitoringRecord)
Called for each new record. Notice, that this method should not throw an exception, but indicate an error by the return value false.

Parameters:
monitoringRecord - the record.
Returns:
true on success; false in case of an error.

newMonitoringRecordNonBlocking

public boolean newMonitoringRecordNonBlocking(IMonitoringRecord monitoringRecord)
Description copied from class: AbstractMonitoringWriter
Overwrite this method if necessary.

Specified by:
newMonitoringRecordNonBlocking in interface IMonitoringWriter
Overrides:
newMonitoringRecordNonBlocking in class AbstractMonitoringWriter
Parameters:
monitoringRecord - the record.
Returns:
true on success; false in case of an error.

toString

public java.lang.String toString()
Description copied from interface: IMonitoringWriter
Delivers a string representation of this writer.

Specified by:
toString in interface IMonitoringWriter
Overrides:
toString in class AbstractMonitoringWriter
Returns:
A string.

Kieker 1.12

Copyright 2015 Kieker Project, http://kieker-monitoring.net