adams.flow.standalone
Class WSServer

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.flow.core.AbstractActor
              extended by adams.flow.standalone.AbstractStandalone
                  extended by adams.flow.standalone.WSServer
All Implemented Interfaces:
AdditionalInformationHandler, CleanUpHandler, Debuggable, DebugOutputHandler, Destroyable, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<AbstractActor>, SizeOfHandler, Stoppable, VariableChangeListener, ErrorHandler, Serializable, Comparable

public class WSServer
extends AbstractStandalone

Runs a webservice.

Valid options are:

-D <int> (property: debugLevel)
    The greater the number the more additional info the scheme may output to 
    the console (0 = off).
    default: 0
    minimum: 0
 
-name <java.lang.String> (property: name)
    The name of the actor.
    default: WSServer
 
-annotation <adams.core.base.BaseText> (property: annotations)
    The annotations to attach to this actor.
    default: 
 
-skip (property: skip)
    If set to true, transformation is skipped and the input token is just forwarded 
    as it is.
 
-stop-flow-on-error (property: stopFlowOnError)
    If set to true, the flow gets stopped in case this actor encounters an error;
     useful for critical actors.
 
-web-service <adams.flow.webservice.WebServiceProvider> (property: webService)
    The webservice to provide.
    default: com.example.customerservice.flow.CustomerServiceWS
 
-log <adams.flow.core.GlobalActorReference> (property: log)
    The name of the global log actor to use (logging disabled if actor not found
    ).
    default: unknown
 

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

Field Summary
protected  GlobalActorHelper m_Helper
          the helper class.
protected  GlobalActorReference m_Log
          the global name.
protected  AbstractActor m_LogActor
          the global log actor.
protected  WebServiceProvider m_WebService
          the webservice to run.
 
Fields inherited from class adams.flow.core.AbstractActor
FILE_EXTENSION, FILE_EXTENSION_GZ, m_Annotations, m_BackupState, m_DetectedObjectVariables, m_DetectedVariables, m_ErrorHandler, m_Executed, m_FullName, m_Headless, m_Name, m_Parent, m_Root, 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
 
Constructor Summary
WSServer()
           
 
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  AbstractActor findGlobalActor()
          Tries to find the global actor referenced by its global name.
 AbstractActor getGlobalActor()
          Returns the currently set global actor.
 GlobalActorReference getLog()
          Returns the name of the global log actor in use.
 String getQuickInfo()
          Returns a quick info about the actor, which will be displayed in the GUI.
 WebServiceProvider getWebService()
          Returns the webservice in use.
 String globalInfo()
          Returns a string describing the object.
 boolean hasGlobalActor()
          Checks whether a reference to the global actor is currently available.
protected  void initialize()
          Initializes the members.
 void log(String msg, String id)
          Logs an error message if a valid global log actor has been set up.
 String logTipText()
          Returns the tip text for this property.
 void setLog(GlobalActorReference value)
          Sets the name of the global log actor to use.
 String setUp()
          Initializes the item for flow execution.
 void setWebService(WebServiceProvider value)
          Sets the webservice to use.
 String webServiceTipText()
          Returns the tip text for this property.
 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, forceVariables, forCommandLine, forName, getAdditionalInformation, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowActors, getFullName, getName, getNextSibling, getParent, getPreviousSibling, getRoot, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, hasErrorHandler, hasStopMessage, index, isBackedUp, isExecuted, isFinished, isHeadless, isStopped, nameTipText, performSetUpChecks, postExecute, preExecute, pruneBackup, pruneBackup, reset, restoreState, setAnnotations, setErrorHandler, setHeadless, setName, setParent, setSkip, setStopFlowOnError, setVariables, shallowCopy, shallowCopy, sizeOf, skipTipText, stopExecution, stopExecution, stopFlowOnErrorTipText, updateDetectedVariables, updatePrefix, updateVariables, variableChanged
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debugLevelTipText, finishInit, getDebugLevel, getOptionManager, 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
 

Field Detail

m_WebService

protected WebServiceProvider m_WebService
the webservice to run.


m_Log

protected GlobalActorReference m_Log
the global name.


m_LogActor

protected AbstractActor m_LogActor
the global log actor.


m_Helper

protected GlobalActorHelper m_Helper
the helper class.

Constructor Detail

WSServer

public WSServer()
Method Detail

globalInfo

public String globalInfo()
Returns a string describing the object.

Specified by:
globalInfo in class AbstractOptionHandler
Returns:
a description suitable for displaying in the gui

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

setWebService

public void setWebService(WebServiceProvider value)
Sets the webservice to use.

Parameters:
value - the webservice to use

getWebService

public WebServiceProvider getWebService()
Returns the webservice in use.

Returns:
the webservice in use

webServiceTipText

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

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

setLog

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

Parameters:
value - the global name

getLog

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

Returns:
the global name

logTipText

public String logTipText()
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
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.

Returns:
the actor, can be null

setUp

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

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

log

public void log(String msg,
                String id)
Logs an error message if a valid global log actor has been set up.

Parameters:
msg - the message to log
id - an optional ID of the data token that failed in the web service

doExecute

protected String doExecute()
Executes the flow item.

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

wrapUp

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

Overrides:
wrapUp in class AbstractActor

cleanUp

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

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


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