public final class TimeReader extends AbstractReaderPlugin
TimestampRecord
instance.System.nanoTime()
as a time source, which is being converted to the global time unit (as defined in the
configuration from the given IProjectContext
).Modifier and Type | Class and Description |
---|---|
protected class |
TimeReader.TimestampEventTask
A simple helper class used to send the current system time.
|
IPlugin.PluginInputPortReference, IPlugin.STATE
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONFIG_PROPERTY_NAME_DELAY_NS
The name of the property determining the initial delay in nanoseconds.
|
static java.lang.String |
CONFIG_PROPERTY_NAME_NUMBER_IMPULSES
The name of the property determining the number of impulses to emit.
|
static java.lang.String |
CONFIG_PROPERTY_NAME_UPDATE_INTERVAL_NS
The name of the property determining the update interval in nanoseconds.
|
static java.lang.String |
CONFIG_PROPERTY_VALUE_DELAY_NS
The default value for the initial delay (0 seconds).
|
static java.lang.String |
CONFIG_PROPERTY_VALUE_NUMBER_IMPULSES
The default value for number of impulses (infinite).
|
static java.lang.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 java.lang.String |
OUTPUT_PORT_NAME_TIMESTAMP_RECORDS
The name of the output port for the timestamp records.
|
static java.lang.String |
OUTPUT_PORT_NAME_TIMESTAMPS
The name of the output port for the timestamps.
|
CONFIG_NAME, configuration, log, LOG, projectContext, recordsTimeUnitFromProjectContext
Constructor and Description |
---|
TimeReader(Configuration configuration,
IProjectContext projectContext)
Creates a new timer using the given configuration.
|
Modifier and Type | Method and Description |
---|---|
Configuration |
getCurrentConfiguration()
This method should deliver a
Configuration object containing the current configuration of this instance. |
boolean |
read()
Starts the reader.
|
protected void |
sendTimestampEvent()
Sends the current system time as a new timestamp event.
|
void |
terminate(boolean error)
Initiates a termination of the plugin.
|
init
areAllRepositoryPortsConnected, connect, connect, deliver, getAllDisplayNames, getAllInputPortNames, getAllOutputPortNames, getAllRepositoryPortNames, getConnectedPlugins, getCurrentRepositories, getDefaultConfiguration, getIncomingPlugins, getPluginDescription, getPluginName, getRepository, getState, isConnectionAllowed, notifyNewIncomingConnection, notifyNewOutgoingConnection, shutdown, start
getName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
connect, getAllDisplayNames, getAllInputPortNames, getAllOutputPortNames, getAllRepositoryPortNames, getConnectedPlugins, getCurrentRepositories, getName, getPluginDescription, getPluginName, getState
public static final java.lang.String OUTPUT_PORT_NAME_TIMESTAMPS
public static final java.lang.String OUTPUT_PORT_NAME_TIMESTAMP_RECORDS
public static final java.lang.String CONFIG_PROPERTY_NAME_UPDATE_INTERVAL_NS
public static final java.lang.String CONFIG_PROPERTY_VALUE_UPDATE_INTERVAL_NS
public static final java.lang.String CONFIG_PROPERTY_NAME_DELAY_NS
public static final java.lang.String CONFIG_PROPERTY_VALUE_DELAY_NS
public static final java.lang.String CONFIG_PROPERTY_NAME_NUMBER_IMPULSES
public static final java.lang.String CONFIG_PROPERTY_VALUE_NUMBER_IMPULSES
public static final long INFINITE_EMITS
public TimeReader(Configuration configuration, IProjectContext projectContext)
configuration
- The configuration containing the properties to initialize this timer.projectContext
- The project context.public void terminate(boolean error)
AnalysisController.terminate(boolean)
instead.
After receiving this notification, the plugin should terminate any running
methods, e.g., read for readers.error
- Determines whether the plugin is terminated due to an error or not.public boolean read()
IPlugin.terminate(boolean)
method can be used
to initiate the termination of this method.public Configuration getCurrentConfiguration()
AbstractAnalysisComponent
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.getCurrentConfiguration
in interface IAnalysisComponent
getCurrentConfiguration
in interface IPlugin
getCurrentConfiguration
in class AbstractAnalysisComponent
protected void sendTimestampEvent()
Copyright 2017 Kieker Project, http://kieker-monitoring.net