Kieker 1.9

kieker.analysis.plugin.reader.timer
Class TimeReader

java.lang.Object
  extended by kieker.analysis.analysisComponent.AbstractAnalysisComponent
      extended by kieker.analysis.plugin.AbstractPlugin
          extended by kieker.analysis.plugin.reader.AbstractReaderPlugin
              extended by kieker.analysis.plugin.reader.timer.TimeReader
All Implemented Interfaces:
IAnalysisComponent, IPlugin, IReaderPlugin

public final class TimeReader
extends AbstractReaderPlugin

This plugin provides the current (system) time in regular intervals. The time is delivered to the two output ports as both a timestamp and a TimestampRecord instance.

The reader can be configured to emit an arbitrary amount of signals. It can also be configured to emit an infinite amount of signals.

The sent timestamps are created using System.nanoTime() as a time source, which is being converted to the global time unit (as defined in the configuration from the given IProjectContext).

Since:
1.8
Author:
Nils Christian Ehmke

Nested Class Summary
 
Nested classes/interfaces inherited from interface kieker.analysis.plugin.IPlugin
IPlugin.PluginInputPortReference, IPlugin.STATE
 
Field Summary
static String CONFIG_PROPERTY_NAME_DELAY_NS
          The name of the property determining the initial delay in nanoseconds.
static String CONFIG_PROPERTY_NAME_NUMBER_IMPULSES
          The name of the property determining the number of impulses to emit.
static String CONFIG_PROPERTY_NAME_UPDATE_INTERVAL_NS
          The name of the property determining the update interval in nanoseconds.
static String CONFIG_PROPERTY_VALUE_DELAY_NS
          The default value for the initial delay (0 seconds).
static String CONFIG_PROPERTY_VALUE_NUMBER_IMPULSES
          The default value for number of impulses (infinite).
static String CONFIG_PROPERTY_VALUE_UPDATE_INTERVAL_NS
          The default value for the update interval (1 second).
static long INFINITE_EMITS
          A value for the number of impulses.
static String OUTPUT_PORT_NAME_TIMESTAMP_RECORDS
          The name of the output port for the timestamp records.
static String OUTPUT_PORT_NAME_TIMESTAMPS
          The name of the output port for the timestamps.
 
Fields inherited from class kieker.analysis.analysisComponent.AbstractAnalysisComponent
CONFIG_NAME
 
Constructor Summary
TimeReader(Configuration configuration, IProjectContext projectContext)
          Creates a new timer using the given configuration.
 
Method Summary
 Configuration getCurrentConfiguration()
          This method should deliver a Configuration object containing the current configuration of this instance.
 boolean read()
          Starts the reader.
 void terminate(boolean error)
          Initiates a termination of the plugin.
 
Methods inherited from class kieker.analysis.plugin.reader.AbstractReaderPlugin
init
 
Methods inherited from class kieker.analysis.plugin.AbstractPlugin
areAllRepositoryPortsConnected, connect, connect, getAllDisplayNames, getAllInputPortNames, getAllOutputPortNames, getAllRepositoryPortNames, getConnectedPlugins, getCurrentRepositories, getIncomingPlugins, getPluginDescription, getPluginName, getState, isConnectionAllowed, shutdown, start
 
Methods inherited from class kieker.analysis.analysisComponent.AbstractAnalysisComponent
getName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface kieker.analysis.plugin.IPlugin
connect, getAllDisplayNames, getAllInputPortNames, getAllOutputPortNames, getAllRepositoryPortNames, getConnectedPlugins, getCurrentRepositories, getName, getPluginDescription, getPluginName, getState
 

Field Detail

OUTPUT_PORT_NAME_TIMESTAMPS

public static final String OUTPUT_PORT_NAME_TIMESTAMPS
The name of the output port for the timestamps.

See Also:
Constant Field Values

OUTPUT_PORT_NAME_TIMESTAMP_RECORDS

public static final String OUTPUT_PORT_NAME_TIMESTAMP_RECORDS
The name of the output port for the timestamp records.

See Also:
Constant Field Values

CONFIG_PROPERTY_NAME_UPDATE_INTERVAL_NS

public static final String CONFIG_PROPERTY_NAME_UPDATE_INTERVAL_NS
The name of the property determining the update interval in nanoseconds.

See Also:
Constant Field Values

CONFIG_PROPERTY_VALUE_UPDATE_INTERVAL_NS

public static final String CONFIG_PROPERTY_VALUE_UPDATE_INTERVAL_NS
The default value for the update interval (1 second).

See Also:
Constant Field Values

CONFIG_PROPERTY_NAME_DELAY_NS

public static final String CONFIG_PROPERTY_NAME_DELAY_NS
The name of the property determining the initial delay in nanoseconds.

See Also:
Constant Field Values

CONFIG_PROPERTY_VALUE_DELAY_NS

public static final String CONFIG_PROPERTY_VALUE_DELAY_NS
The default value for the initial delay (0 seconds).

See Also:
Constant Field Values

CONFIG_PROPERTY_NAME_NUMBER_IMPULSES

public static final String CONFIG_PROPERTY_NAME_NUMBER_IMPULSES
The name of the property determining the number of impulses to emit.

See Also:
Constant Field Values

CONFIG_PROPERTY_VALUE_NUMBER_IMPULSES

public static final String CONFIG_PROPERTY_VALUE_NUMBER_IMPULSES
The default value for number of impulses (infinite).

See Also:
Constant Field Values

INFINITE_EMITS

public static final long INFINITE_EMITS
A value for the number of impulses. It makes sure that the reader emits an infinite amount of signals.

See Also:
Constant Field Values
Constructor Detail

TimeReader

public TimeReader(Configuration configuration,
                  IProjectContext projectContext)
Creates a new timer using the given configuration.

Parameters:
configuration - The configuration containing the properties to initialize this timer.
projectContext - The project context.
Method Detail

terminate

public void terminate(boolean error)
Initiates a termination of the plugin. This method is only used by the framework and should not be called manually. Use the method AnalysisController.terminate(boolean) instead. After receiving this notification, the plugin should terminate any running methods, e.g., read for readers.

Parameters:
error - Determines whether the plugin is terminated due to an error or not.

read

public boolean read()
Starts the reader. This method is intended to be a blocking operation, i.e., it is assumed that reading has finished before this method returns. The method should indicate an error by the return value false. In asynchronous scenarios, the IPlugin.terminate(boolean) method can be used to initiate the termination of this method.

Returns:
true if reading was successful; false if an error occurred

getCurrentConfiguration

public Configuration getCurrentConfiguration()
Description copied from class: AbstractAnalysisComponent
This method should deliver a Configuration object containing the current configuration of this instance. In other words: The constructor should be able to use the given object to initialize a new instance of this class with the same intern properties.

Specified by:
getCurrentConfiguration in interface IAnalysisComponent
Specified by:
getCurrentConfiguration in interface IPlugin
Specified by:
getCurrentConfiguration in class AbstractAnalysisComponent
Returns:
A completely filled configuration object.

Kieker 1.9

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