public class SourceTimer extends AbstractSource
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONFIG_CONTENT_CLASS
Configuration-parameter containing information concerning the context the
Timer's output will be used for.
|
static java.lang.String |
CONFIG_NUMBER_OF_CHANNELS
Configuration-parameter containing information concerning the number of
channels.
|
static java.lang.String |
CONFIG_PERIOD
Configuration-parameter containing information concerning the period in
which the Timer will fire events [in Hz].
|
static java.lang.String |
CONFIG_SAMPLE_RATE
Configuration-parameter specifying the samplerate in which events can
occur.
|
Constructor and Description |
---|
SourceTimer(LifeCycleManager manager,
java.util.HashMap<java.lang.String,java.lang.String> configuration)
Create new
SourceTimer |
Modifier and Type | Method and Description |
---|---|
protected void |
configure()
Performs custom configuration-tasks (e.g. creating connections to
databases, etc.).
|
DataDescription[] |
getOutputDescription()
Returns a
DataDescription describing the data, the Source provides. |
protected void |
measure()
Called to indicate the component to start measuring, that is sending,
respectively processing data, that is valid for the studie's results.
|
protected void |
stop()
Performs custom stopping-tasks (e.g. releasing connections etc).
|
protected void |
train()
Indicates that the System is now in
State.TRAINING . |
getSourceConnector, initConnector, writeOutput
configureComponent, disableMeasuring, enableMeasuring, getLifeCycleManager, getState, isReadyToMeasure, measureComponent, stopComponent, trainComponent
public static final java.lang.String CONFIG_CONTENT_CLASS
public static final java.lang.String CONFIG_SAMPLE_RATE
public static final java.lang.String CONFIG_NUMBER_OF_CHANNELS
SourceTimer
is sending DataEvent
s, this
parameter has no effect on it's functionality, but may be necessary in
order to match the timer to other components. [optional]public static final java.lang.String CONFIG_PERIOD
public SourceTimer(LifeCycleManager manager, java.util.HashMap<java.lang.String,java.lang.String> configuration) throws InstantiationException
SourceTimer
manager
- LifeCycleManager
to register to.configuration
- HashMap
containing configuration.InstantiationException
- if configuration is invalid.public DataDescription[] getOutputDescription()
Source
DataDescription
describing the data, the Source
provides.DataDescription
describing the data, the Source
provides.protected void configure()
SystemComponent
State.CONFIG
.configure
in class SystemComponent
protected void train()
SystemComponent
State.TRAINING
.SystemComponent
s are supposed to start producing data as soon as
they enter this state, for a lot of data is timed relative to the entry
of State.TRAINING
. The produced data does not have to be valid,
though it should be reasonable to enable SystemComponent
s
following in the dispatching-chain to train themselves to the form of
incoming data.train
in class SystemComponent
protected void measure()
SystemComponent
State.MEASURING
, which follows the
State.TRAINING
.measure
in class SystemComponent
protected void stop()
SystemComponent
SystemComponent
's
life-cycle.stop
in class SystemComponent