Package adams.flow.webservice
Class AbstractWebServiceProvider
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.webservice.AbstractWebServiceProvider
-
- All Implemented Interfaces:
adams.core.CleanUpHandler,adams.core.Destroyable,adams.core.GlobalInfoSupporter,adams.core.logging.LoggingLevelHandler,adams.core.logging.LoggingSupporter,adams.core.option.OptionHandler,adams.core.SizeOfHandler,adams.flow.core.FlowContextHandler,WebServiceProvider,Serializable
- Direct Known Subclasses:
AbstractWebServiceProviderWithCallableTransformer,CustomerServiceWS,RatsBlobServiceWS,RatsTextServiceWS
public abstract class AbstractWebServiceProvider extends adams.core.option.AbstractOptionHandler implements WebServiceProvider
Ancestor for servers providing webservices.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractInInterceptorGeneratorm_InInterceptorthe interceptor generator for incoming messages.protected AbstractOutInterceptorGeneratorm_OutInterceptorthe interceptor generator for outgoing messages.protected adams.flow.core.Actorm_Ownerthe owning actor.protected booleanm_Runningwhether the webservice is running.protected Stringm_URLthe URL of the webservice.
-
Constructor Summary
Constructors Constructor Description AbstractWebServiceProvider()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcheck()Performs some initial checks before starting the service.voidcleanUp()Cleans up data structures, frees up memory.protected voidconfigureInterceptors(org.apache.cxf.jaxws.EndpointImpl endpoint)Configures the interceptors/logging for the endpoint (incoming and outgoing).protected voidconfigureTLS(org.apache.cxf.jaxws.EndpointImpl endpoint, String url)Configures TLS support (if using https:// and actors present in flow).voiddefineOptions()Adds options to the internal list of options.protected abstract voiddoStart()Performs the actual start of the service.protected abstract voiddoStop()Performs the actual stop of the service.protected AbstractInInterceptorGeneratorgetDefaultInInterceptor()Returns the default interceptor for incoming messages.protected AbstractOutInterceptorGeneratorgetDefaultOutInterceptor()Returns the default interceptor for outgoing messages.abstract StringgetDefaultURL()Returns the default URL for the service.adams.flow.core.ActorgetFlowContext()Returns the owning actor.AbstractInInterceptorGeneratorgetInInterceptor()Returns the interceptor for incoming messages.AbstractOutInterceptorGeneratorgetOutInterceptor()Returns the interceptor for outgoing messages.StringgetURL()Returns the URL used for the service.StringinInterceptorTipText()Returns the tip text for this property.booleanisRunning()Returns whether the service is running.voidlog(String msg, String id)Logs an error message if a valid global log actor has been set up.StringoutInterceptorTipText()Returns the tip text for this property.voidsetFlowContext(adams.flow.core.Actor value)Sets the actor that executes this webservice.voidsetInInterceptor(AbstractInInterceptorGenerator value)Sets the interceptor for incoming messages.voidsetOutInterceptor(AbstractOutInterceptorGenerator value)Sets the interceptor for outgoing messages.voidsetURL(String value)Sets the URL to use.Stringstart()Starts the service.Stringstop()Stops the service.StringURLTipText()Returns the tip text for this property.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_Owner
protected adams.flow.core.Actor m_Owner
the owning actor.
-
m_URL
protected String m_URL
the URL of the webservice.
-
m_InInterceptor
protected AbstractInInterceptorGenerator m_InInterceptor
the interceptor generator for incoming messages.
-
m_OutInterceptor
protected AbstractOutInterceptorGenerator m_OutInterceptor
the interceptor generator for outgoing messages.
-
m_Running
protected boolean m_Running
whether the webservice is running.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin classadams.core.option.AbstractOptionHandler
-
setFlowContext
public void setFlowContext(adams.flow.core.Actor value)
Sets the actor that executes this webservice.- Specified by:
setFlowContextin interfaceadams.flow.core.FlowContextHandler- Specified by:
setFlowContextin interfaceWebServiceProvider- Parameters:
value- the owner
-
getFlowContext
public adams.flow.core.Actor getFlowContext()
Returns the owning actor.- Specified by:
getFlowContextin interfaceadams.flow.core.FlowContextHandler- Specified by:
getFlowContextin interfaceWebServiceProvider- 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:
getURLin interfaceWebServiceProvider- 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.
-
getDefaultInInterceptor
protected AbstractInInterceptorGenerator getDefaultInInterceptor()
Returns the default interceptor for incoming messages.- Returns:
- the interceptor
-
setInInterceptor
public void setInInterceptor(AbstractInInterceptorGenerator value)
Sets the interceptor for incoming messages.- Specified by:
setInInterceptorin interfaceWebServiceProvider- Parameters:
value- the interceptor
-
getInInterceptor
public AbstractInInterceptorGenerator getInInterceptor()
Returns the interceptor for incoming messages.- Specified by:
getInInterceptorin interfaceWebServiceProvider- Returns:
- the interceptor
-
inInterceptorTipText
public String inInterceptorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDefaultOutInterceptor
protected AbstractOutInterceptorGenerator getDefaultOutInterceptor()
Returns the default interceptor for outgoing messages.- Returns:
- the interceptor
-
setOutInterceptor
public void setOutInterceptor(AbstractOutInterceptorGenerator value)
Sets the interceptor for outgoing messages.- Specified by:
setOutInterceptorin interfaceWebServiceProvider- Parameters:
value- the interceptor
-
getOutInterceptor
public AbstractOutInterceptorGenerator getOutInterceptor()
Returns the interceptor for outgoing messages.- Specified by:
getOutInterceptorin interfaceWebServiceProvider- Returns:
- the interceptor
-
outInterceptorTipText
public String outInterceptorTipText()
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 logid- an optional ID of the data token that failed in the web service
-
configureInterceptors
protected void configureInterceptors(org.apache.cxf.jaxws.EndpointImpl endpoint)
Configures the interceptors/logging for the endpoint (incoming and outgoing).- Parameters:
endpoint- the endpoint to configure- See Also:
m_InInterceptor,m_OutInterceptor
-
configureTLS
protected void configureTLS(org.apache.cxf.jaxws.EndpointImpl endpoint, String url) throws ExceptionConfigures TLS support (if using https:// and actors present in flow).- Parameters:
endpoint- the (unpublished) endpoint to configureurl- the URL to publish under- Throws:
IllegalStateException- if https used but failed to configure TLS paramsException
-
doStart
protected abstract void doStart() throws ExceptionPerforms the actual start of the service.- Throws:
Exception- if start fails
-
start
public String start()
Starts the service.- Specified by:
startin interfaceWebServiceProvider- Returns:
- null if successful, otherwise error message
-
isRunning
public boolean isRunning()
Returns whether the service is running.- Specified by:
isRunningin interfaceWebServiceProvider- Returns:
- true if running
-
doStop
protected abstract void doStop() throws ExceptionPerforms the actual stop of the service.- Throws:
Exception- if stopping fails
-
stop
public String stop()
Stops the service.- Specified by:
stopin interfaceWebServiceProvider- Returns:
- null if successful, otherwise error message
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUpin interfaceadams.core.CleanUpHandler- Specified by:
cleanUpin interfaceWebServiceProvider
-
-