de.cau.cs.kieler.klots.kiemdatacomponents
Class NXTDataDistributor
java.lang.Object
de.cau.cs.kieler.sim.kiem.internal.AbstractDataComponent
de.cau.cs.kieler.sim.kiem.JSONObjectDataComponent
de.cau.cs.kieler.klots.kiemdatacomponents.NXTDataDistributor
- All Implemented Interfaces:
- IDataComponent, IJSONObjectDataComponent, IExecutableExtension
public class NXTDataDistributor
- extends JSONObjectDataComponent
- implements IJSONObjectDataComponent
- Rating

Method Summary |
void |
initialize()
Initialize. |
boolean |
isObserver()
To check whether the DataComponent is an observer. |
boolean |
isProducer()
To check whether the DataComponent is a producer. |
JSONObject |
step(JSONObject jSONObject)
Step method for a DataObserver and a DataPrroducer. |
void |
wrapup()
Wrap-up. |
Methods inherited from class de.cau.cs.kieler.sim.kiem.internal.AbstractDataComponent |
checkProperties, finalize, getConfigurationElement, getCurrentComponentID, getDataComponentId, getName, getPluginId, getProperties, getShell, isDeltaObserver, isHistoryObserver, isHistoryStep, isInvisible, isMacroStepDone, isMaster, isMasterImplementingGUI, isMultiInstantiable, masterCommand, masterGetAimedStepDuration, masterGUI, masterGUIisEnabled, masterIsPaused, masterIsRunning, masterSetAimedStepDuration, masterSetKIEMInstance, notifyEvent, provideEventOfInterest, provideFilterKeys, provideProperties, setConfigurationElemenet, setCurrentComponentID, setHistoryStep, setInitializationData, setProperties |
NXTDataDistributor
public NXTDataDistributor()
initialize
public void initialize()
throws KiemInitializationException
- Initialize. Do some initializing prior to execution. If an error occurs during
initialization, the DataComponent should raise a
KiemInitializationException
.
- Specified by:
initialize
in interface IDataComponent
- Throws:
KiemInitializationException
- a KiemInitializationException
wrapup
public void wrapup()
throws KiemInitializationException
- Wrap-up. Do some wrapping-up after execution has finished. If an error occurs during wrap up,
the DataComponent should raise a
KiemInitializationException
.
- Specified by:
wrapup
in interface IDataComponent
- Throws:
KiemInitializationException
- a KiemInitializationException
isProducer
public boolean isProducer()
- To check whether the DataComponent is a producer. If the DataComponent is a producer it
should return != null in its step() method.
- Specified by:
isProducer
in interface IDataComponent
- Returns:
- true, if is producer
isObserver
public boolean isObserver()
- To check whether the DataComponent is an observer. If the DataComponent is an observer the
arguments in its step() method will be != null.
- Specified by:
isObserver
in interface IDataComponent
- Returns:
- true, if is observer
step
public JSONObject step(JSONObject jSONObject)
throws KiemExecutionException
- Step method for a DataObserver and a DataPrroducer.
For a producer only the argument will always be null. For an observer only this method will
be called asynchronous. This may mean that in case the observer is slow, it may be skipped at
some consecutive steps until it becomes ready again. If this is not desired and the observer
MUST NOT be skipped, then the DataComponent should also be a DataProducer but return
just null.
If an error occurs during the execution of the step method, a DataComponent should raise a
KiemExecutionException
that is then catched by the execution manager an brought to
the user's attention.
- Specified by:
step
in interface IJSONObjectDataComponent
- Parameters:
jSONObject
- the concrete JSONObject of input data (if observer)
- Returns:
- the JSONObject with the output data (if producer)
- Throws:
KiemExecutionException
- a KiemExecutionException