de.cau.cs.kieler.sim.kiem.automated.data
Class AutoTestComponent

java.lang.Object
  extended by de.cau.cs.kieler.sim.kiem.internal.AbstractDataComponent
      extended by de.cau.cs.kieler.sim.kiem.JSONObjectDataComponent
          extended by de.cau.cs.kieler.sim.kiem.ui.datacomponent.JSONObjectSimulationDataComponent
              extended by de.cau.cs.kieler.sim.kiem.automated.AbstractAutomatedComponent
                  extended by de.cau.cs.kieler.sim.kiem.automated.AbstractAutomatedProducer
                      extended by de.cau.cs.kieler.sim.kiem.automated.data.AutoTestComponent
All Implemented Interfaces:
IAutomatedComponent, IAutomatedProducer, IDataComponent, IJSONObjectDataComponent, IExecutableExtension

public class AutoTestComponent
extends AbstractAutomatedProducer

This class is just for testing the automated execution feature. No real need to review it.

Rating red

Nested Class Summary
 
Nested classes/interfaces inherited from class de.cau.cs.kieler.sim.kiem.ui.datacomponent.JSONObjectSimulationDataComponent
JSONObjectSimulationDataComponent.M2MProgressMonitor
 
Field Summary
 
Fields inherited from class de.cau.cs.kieler.sim.kiem.ui.datacomponent.JSONObjectSimulationDataComponent
activePage, activePageFlag, exception, modelEditor
 
Fields inherited from class de.cau.cs.kieler.sim.kiem.internal.AbstractDataComponent
MASTER_CMD_MACROSTEP, MASTER_CMD_PAUSE, MASTER_CMD_RUN, MASTER_CMD_STEP, MASTER_CMD_STEPBACK, MASTER_CMD_STOP
 
Fields inherited from interface de.cau.cs.kieler.sim.kiem.automated.IAutomatedComponent
ANY_TYPE, ANY_TYPE_ARRAY, ITERATION, MODEL_FILE
 
Constructor Summary
AutoTestComponent()
           
 
Method Summary
 JSONObject doStep(JSONObject jSONObject)
          Implements the real step method for this simulation datacomponent.
 String[] getSupportedExtensions()
          This component doesn't support any files.
 void initialize()
          Initialize.
 boolean isObserver()
          To check whether the DataComponent is an observer.
 boolean isProducer()
          To check whether the DataComponent is a producer.
 List<KiemProperty> produceInformation()
          The default implementation produces no information.
 void setParameters(List<KiemProperty> properties)
          The default implementation only retrieves the model file and the current iteration index.
 int wantsMoreRuns()
          The default implementation doesn't need any runs.
 int wantsMoreSteps()
          The default implementation doesn't need any steps.
 void wrapup()
          Wrap-up.
 
Methods inherited from class de.cau.cs.kieler.sim.kiem.automated.AbstractAutomatedProducer
produceModelFileInformation
 
Methods inherited from class de.cau.cs.kieler.sim.kiem.automated.AbstractAutomatedComponent
getIteration, getModelFile, getNumberOfAdditionalIterations, getNumberOfAdditionalSteps
 
Methods inherited from class de.cau.cs.kieler.sim.kiem.ui.datacomponent.JSONObjectSimulationDataComponent
bringProblemsViewToFront, checkModelValidation, checkProperties, doModel2ModelTransform, doProvideInitialVariables, doProvideProperties, getActivePage, getEditor, getInputEditor, getInputModel, getInputModelAsURI, getInputModelEObject, getInputResourceSet, getInputWorkspaceModel, getModelRootElement, getNotationElement, isTransformationCompleted, isTransformationError, provideFilterKeysJSON, provideInitialVariables, provideProperties, resolveBundelFile, step
 
Methods inherited from class de.cau.cs.kieler.sim.kiem.JSONObjectDataComponent
getInitialVariables, setInitialVariables
 
Methods inherited from class de.cau.cs.kieler.sim.kiem.internal.AbstractDataComponent
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, setConfigurationElemenet, setCurrentComponentID, setHistoryStep, setInitializationData, setProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.cau.cs.kieler.sim.kiem.automated.IAutomatedComponent
getNumberOfAdditionalIterations, getNumberOfAdditionalSteps
 

Constructor Detail

AutoTestComponent

public AutoTestComponent()
Method Detail

produceInformation

public List<KiemProperty> produceInformation()
The default implementation produces no information. Subclasses should override this.

Specified by:
produceInformation in interface IAutomatedProducer
Overrides:
produceInformation in class AbstractAutomatedProducer
Returns:
null

setParameters

public void setParameters(List<KiemProperty> properties)
The default implementation only retrieves the model file and the current iteration index. Subclasses should extend this method.

Specified by:
setParameters in interface IAutomatedComponent
Overrides:
setParameters in class AbstractAutomatedComponent
Parameters:
properties - the properties passed before each execution

doStep

public JSONObject doStep(JSONObject jSONObject)
                  throws KiemExecutionException
Implements the real step method for this simulation datacomponent.

Overrides:
doStep in class JSONObjectSimulationDataComponent
Parameters:
jSONObject - the j son object
Returns:
the jSON object
Throws:
KiemExecutionException - the kiem execution exception

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
Overrides:
initialize in class JSONObjectSimulationDataComponent
Throws:
KiemInitializationException - a KiemInitializationException

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
Overrides:
isObserver in class JSONObjectSimulationDataComponent
Returns:
true, if is observer

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
Overrides:
isProducer in class JSONObjectSimulationDataComponent
Returns:
true, if is producer

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.

Throws:
KiemInitializationException - a KiemInitializationException

wantsMoreRuns

public int wantsMoreRuns()
The default implementation doesn't need any runs. Subclasses should override this method.

Specified by:
wantsMoreRuns in interface IAutomatedComponent
Overrides:
wantsMoreRuns in class AbstractAutomatedComponent
Returns:
0

wantsMoreSteps

public int wantsMoreSteps()
The default implementation doesn't need any steps. Subclasses should override this method.

Specified by:
wantsMoreSteps in interface IAutomatedComponent
Overrides:
wantsMoreSteps in class AbstractAutomatedComponent
Returns:
0

getSupportedExtensions

public String[] getSupportedExtensions()
This component doesn't support any files. Subclasses should override this to indicate which type of file they support. Example: types = {"kixs", "strl}; types = IAutomatedComponent.ANY_TYPE;

Specified by:
getSupportedExtensions in interface IAutomatedComponent
Overrides:
getSupportedExtensions in class AbstractAutomatedComponent
Returns:
null