adams.flow.webservice
Class AbstractWebServiceProvider

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.flow.webservice.AbstractWebServiceProvider
All Implemented Interfaces:
Debuggable, Destroyable, OptionHandler, SizeOfHandler, WebServiceProvider, Serializable
Direct Known Subclasses:
AbstractWebServiceProviderWithGlobalTransformer, CustomerServiceWS

public abstract class AbstractWebServiceProvider
extends AbstractOptionHandler
implements WebServiceProvider

Ancestor for servers providing webservices.

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

Field Summary
protected  AbstractActor m_Owner
          the owning actor.
protected  String m_URL
          the URL of the webservice.
 
Fields inherited from class adams.core.option.AbstractOptionHandler
m_DebugLevel, m_OptionManager
 
Constructor Summary
AbstractWebServiceProvider()
           
 
Method Summary
protected  void check()
          Performs some initial checks before starting the service.
 void defineOptions()
          Adds options to the internal list of options.
protected abstract  void doStart()
          Performs the actual start of the service.
protected abstract  void doStop()
          Performs the actual stop of the service.
abstract  String getDefaultURL()
          Returns the default URL for the service.
 AbstractActor getOwner()
          Returns the owning actor.
 String getURL()
          Returns the URL used for the service.
 void log(String msg, String id)
          Logs an error message if a valid global log actor has been set up.
 void setOwner(AbstractActor value)
          Sets the actor that executes this webservice.
 void setURL(String value)
          Sets the URL to use.
 String start()
          Starts the server.
 String stop()
          Stops the server.
 String URLTipText()
          Returns the tip text for this property.
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debug, debugLevelTipText, destroy, finishInit, getDebugLevel, getOptionManager, globalInfo, initialize, isDebugOn, newOptionManager, reset, setDebugLevel, toCommandLine, toString
 
Methods inherited from class adams.core.ConsoleObject
getDebugging, getSystemErr, getSystemOut, sizeOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_Owner

protected AbstractActor m_Owner
the owning actor.


m_URL

protected String m_URL
the URL of the webservice.

Constructor Detail

AbstractWebServiceProvider

public AbstractWebServiceProvider()
Method Detail

defineOptions

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

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

setOwner

public void setOwner(AbstractActor value)
Sets the actor that executes this webservice.

Specified by:
setOwner in interface WebServiceProvider
Parameters:
value - the owner

getOwner

public AbstractActor getOwner()
Returns the owning actor.

Specified by:
getOwner in interface WebServiceProvider
Returns:
the owner

getDefaultURL

public abstract String getDefaultURL()
Returns the default URL for the service.

Returns:
the URL

setURL

public void setURL(String value)
Sets the URL to use.

Parameters:
value - the URL to use

getURL

public String getURL()
Returns the URL used for the service.

Specified by:
getURL in interface WebServiceProvider
Returns:
the URL

URLTipText

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

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

check

protected void check()
Performs some initial checks before starting the service.

Default implementation does nothing.


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

doStart

protected abstract void doStart()
                         throws Exception
Performs the actual start of the service.

Throws:
Exception - if start fails

start

public String start()
Starts the server.

Specified by:
start in interface WebServiceProvider
Returns:
null if successful, otherwise error message

doStop

protected abstract void doStop()
                        throws Exception
Performs the actual stop of the service.

Throws:
Exception - if stopping fails

stop

public String stop()
Stops the server.

Specified by:
stop in interface WebServiceProvider
Returns:
null if successful, otherwise error message


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