adams.flow.core
Class AbstractCopyGlobalActor

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.flow.core.AbstractActor
              extended by adams.flow.core.AbstractCopyGlobalActor
All Implemented Interfaces:
AdditionalInformationHandler, CleanUpHandler, Debuggable, DebugOutputHandler, Destroyable, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<AbstractActor>, SizeOfHandler, Stoppable, VariableChangeListener, Actor, ErrorHandler, GlobalActorUser, Serializable, Comparable
Direct Known Subclasses:
CopyGlobalSink, CopyGlobalSource, CopyGlobalStandalone, CopyGlobalTransformer

public abstract class AbstractCopyGlobalActor
extends AbstractActor
implements GlobalActorUser

Ancestor for actors that use a copy of a global actor.

Version:
$Revision: 6830 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
protected  AbstractActor m_GlobalActor
          the global actor.
protected  GlobalActorReference m_GlobalName
          the global name.
protected  GlobalActorHelper m_Helper
          the helper class.
 
Fields inherited from class adams.flow.core.AbstractActor
m_Annotations, m_BackupState, m_DetectedObjectVariables, m_DetectedVariables, m_ErrorHandler, m_Executed, m_Executing, m_ExecutionListeningSupporter, m_FullName, m_Headless, m_Name, m_Parent, m_Root, m_ScopeHandler, m_Self, m_Skip, m_StopFlowOnError, m_StopMessage, m_Stopped, m_StorageHandler, m_VariablesUpdated
 
Fields inherited from class adams.core.option.AbstractOptionHandler
m_DebugLevel, m_OptionManager
 
Fields inherited from interface adams.flow.core.Actor
FILE_EXTENSION, FILE_EXTENSION_GZ
 
Constructor Summary
AbstractCopyGlobalActor()
           
 
Method Summary
 void cleanUp()
          Cleans up after the execution has finished.
 void defineOptions()
          Adds options to the internal list of options.
protected  String doExecute()
          Executes the flow item.
protected abstract  String executeGlobalActor()
          Executes the global actor.
protected  AbstractActor findGlobalActor()
          Tries to find the global actor referenced by its global name.
protected  void forceVariables(Variables value)
          Updates the Variables instance in use.
 AbstractActor getGlobalActor()
          Returns the currently set global actor.
 GlobalActorReference getGlobalName()
          Returns the name of the global actor in use.
 String getQuickInfo()
          Returns a quick info about the actor, which will be displayed in the GUI.
 String globalNameTipText()
          Returns the tip text for this property.
 boolean hasGlobalActor()
          Checks whether a reference to the global actor is currently available.
protected  void initialize()
          Initializes the members.
 boolean isFinished()
          Returns whether the actor has finished.
 void setGlobalName(GlobalActorReference value)
          Sets the name of the global actor to use.
 String setUp()
          Initializes the item for flow execution.
 void stopExecution()
          Stops the execution.
 void wrapUp()
          Cleans up after the execution has finished.
 
Methods inherited from class adams.flow.core.AbstractActor
annotationsTipText, backupState, canInspectOptions, canPerformSetUpCheck, compareTo, debug, destroy, equals, execute, findVariables, findVariables, findVariables, forCommandLine, forName, getAdditionalInformation, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowActors, getFlowExecutionListeningSupporter, getFullName, getName, getNextSibling, getParent, getParentComponent, getPreviousSibling, getRoot, getScopeHandler, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, handleException, hasErrorHandler, hasStopMessage, index, isBackedUp, isExecuted, isExecuting, isHeadless, isStopped, nameTipText, performSetUpChecks, postExecute, preExecute, pruneBackup, pruneBackup, reset, restoreState, setAnnotations, setErrorHandler, setHeadless, setName, setParent, setSkip, setStopFlowOnError, setVariables, shallowCopy, shallowCopy, sizeOf, skipTipText, stopExecution, stopFlowOnErrorTipText, updateDetectedVariables, updatePrefix, updateVariables, variableChanged
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debugLevelTipText, finishInit, getDebugLevel, getOptionManager, globalInfo, isDebugOn, newOptionManager, setDebugLevel, toCommandLine, toString
 
Methods inherited from class adams.core.ConsoleObject
getDebugging, getSystemErr, getSystemOut
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface adams.flow.core.Actor
compareTo, debug, destroy, equals, execute, findVariables, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowExecutionListeningSupporter, getFullName, getName, getNextSibling, getParent, getParentComponent, getPreviousSibling, getRoot, getScopeHandler, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, hasErrorHandler, hasStopMessage, index, isExecuted, isHeadless, isStopped, setAnnotations, setErrorHandler, setHeadless, setName, setParent, setSkip, setStopFlowOnError, setVariables, sizeOf, stopExecution, variableChanged
 
Methods inherited from interface adams.core.AdditionalInformationHandler
getAdditionalInformation
 
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager
 

Field Detail

m_GlobalName

protected GlobalActorReference m_GlobalName
the global name.


m_GlobalActor

protected AbstractActor m_GlobalActor
the global actor.


m_Helper

protected GlobalActorHelper m_Helper
the helper class.

Constructor Detail

AbstractCopyGlobalActor

public AbstractCopyGlobalActor()
Method Detail

defineOptions

public void defineOptions()
Adds options to the internal list of options.

Specified by:
defineOptions in interface OptionHandler
Overrides:
defineOptions in class AbstractActor

initialize

protected void initialize()
Initializes the members.

Overrides:
initialize in class AbstractActor

setGlobalName

public void setGlobalName(GlobalActorReference value)
Sets the name of the global actor to use.

Parameters:
value - the global name

getGlobalName

public GlobalActorReference getGlobalName()
Returns the name of the global actor in use.

Returns:
the global name

globalNameTipText

public String globalNameTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the GUI or for listing the options.

getQuickInfo

public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.

Specified by:
getQuickInfo in interface QuickInfoSupporter
Specified by:
getQuickInfo in interface Actor
Overrides:
getQuickInfo in class AbstractActor
Returns:
null if no info available, otherwise short string

findGlobalActor

protected AbstractActor findGlobalActor()
Tries to find the global actor referenced by its global name.

Returns:
the global actor or null if not found

hasGlobalActor

public boolean hasGlobalActor()
Checks whether a reference to the global actor is currently available.

Returns:
true if a reference is available
See Also:
getGlobalActor()

getGlobalActor

public AbstractActor getGlobalActor()
Returns the currently set global actor.

Specified by:
getGlobalActor in interface GlobalActorUser
Returns:
the actor, can be null

forceVariables

protected void forceVariables(Variables value)
Updates the Variables instance in use.

Use with caution!

Overrides:
forceVariables in class AbstractActor
Parameters:
value - the instance to use

setUp

public String setUp()
Initializes the item for flow execution.

Specified by:
setUp in interface Actor
Overrides:
setUp in class AbstractActor
Returns:
null if everything is fine, otherwise error message

executeGlobalActor

protected abstract String executeGlobalActor()
Executes the global actor. Derived classes might need to override this method to ensure atomicity.

Returns:
null if no error, otherwise error message

doExecute

protected String doExecute()
Executes the flow item.

Specified by:
doExecute in class AbstractActor
Returns:
null if everything is fine, otherwise error message

isFinished

public boolean isFinished()
Returns whether the actor has finished.

Specified by:
isFinished in interface Actor
Overrides:
isFinished in class AbstractActor
Returns:
true if finished

stopExecution

public void stopExecution()
Stops the execution. No message set.

Specified by:
stopExecution in interface Stoppable
Specified by:
stopExecution in interface Actor
Overrides:
stopExecution in class AbstractActor

wrapUp

public void wrapUp()
Cleans up after the execution has finished. Graphical output is left untouched.

Specified by:
wrapUp in interface Actor
Overrides:
wrapUp in class AbstractActor

cleanUp

public void cleanUp()
Cleans up after the execution has finished.

Specified by:
cleanUp in interface CleanUpHandler
Specified by:
cleanUp in interface Actor
Overrides:
cleanUp in class AbstractActor


Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.