Kieker 1.9

kieker.monitoring.writer.database
Class SyncDbWriter

java.lang.Object
  extended by kieker.monitoring.writer.AbstractMonitoringWriter
      extended by kieker.monitoring.writer.database.SyncDbWriter
All Implemented Interfaces:
IMonitoringRecordReceiver, IMonitoringWriter

public final class SyncDbWriter
extends AbstractMonitoringWriter

Stores monitoring data into a database. Warning! This class is an academic prototype and not intended for usage in any critical system.

Since:
< 0.9
Author:
Jan Waller

Field Summary
static String CONFIG_CONNECTIONSTRING
           
static String CONFIG_DRIVERCLASSNAME
           
static String CONFIG_OVERWRITE
           
static String CONFIG_TABLEPREFIX
           
 
Constructor Summary
SyncDbWriter(Configuration configuration)
          Creates a new instance of this class using the given parameter.
 
Method Summary
 void init()
          Implementing classes should indicate an initialization error by throwing an Exception.
 boolean newMonitoringRecord(IMonitoringRecord record)
          Called for each new record.
 void terminate()
          Called by the Monitoring Controller to announce a shutdown of monitoring.
 String toString()
          Delivers a string representation of this writer.
 
Methods inherited from class kieker.monitoring.writer.AbstractMonitoringWriter
newMonitoringRecordNonBlocking, setController
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONFIG_DRIVERCLASSNAME

public static final String CONFIG_DRIVERCLASSNAME

CONFIG_CONNECTIONSTRING

public static final String CONFIG_CONNECTIONSTRING

CONFIG_TABLEPREFIX

public static final String CONFIG_TABLEPREFIX

CONFIG_OVERWRITE

public static final String CONFIG_OVERWRITE
Constructor Detail

SyncDbWriter

public SyncDbWriter(Configuration configuration)
             throws Exception
Creates a new instance of this class using the given parameter.

Parameters:
configuration - The configuration which will be used to initialize this writer.
Throws:
Exception - If the constructor failed to establish a connection to the database.
Method Detail

init

public final void init()
                throws Exception
Description copied from class: AbstractMonitoringWriter
Implementing classes should indicate an initialization error by throwing an Exception.

Throws:
Exception - If something during the initialization went wrong.

newMonitoringRecord

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

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

terminate

public void terminate()
Called by the Monitoring Controller to announce a shutdown of monitoring. Writers should return as soon as it is safe to terminate Kieker.


toString

public 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.9

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