org.mule.service
Class AbstractService

java.lang.Object
  extended by org.mule.service.AbstractService
All Implemented Interfaces:
Serializable, AnnotatedObject, FlowConstruct, Disposable, Initialisable, Lifecycle, LifecycleStateEnabled, Startable, Stoppable, NameableObject, NamedObject, MessageProcessor, Service
Direct Known Subclasses:
SedaService

Deprecated.

@Deprecated
public abstract class AbstractService
extends Object
implements Service, MessageProcessor, AnnotatedObject

A base implementation for all Services in Mule

See Also:
Serialized Form

Field Summary
protected  ServiceAsyncReplyCompositeMessageSource asyncReplyMessageSource
          Deprecated.  
protected  Component component
          Deprecated.  
protected  MessagingExceptionHandler exceptionListener
          Deprecated. The exception strategy used by the service.
static String INITIAL_STATE_PAUSED
          Deprecated.  
static String INITIAL_STATE_STARTED
          Deprecated.  
static String INITIAL_STATE_STOPPED
          Deprecated. The initial states that the service can be started in
protected  String initialState
          Deprecated. Determines the initial state of this service when the model starts.
protected  ServiceLifecycleManager lifecycleManager
          Deprecated.  
protected  Log logger
          Deprecated. logger used by this class
protected  MessageInfoMapping messageInfoMapping
          Deprecated.  
protected  MessageProcessorChain messageProcessorChain
          Deprecated.  
protected  MessageSource messageSource
          Deprecated.  
protected  Model model
          Deprecated. The model in which this service is registered
protected  MuleContext muleContext
          Deprecated.  
protected  String name
          Deprecated. The service's name
protected  MessageProcessor outboundRouter
          Deprecated.  
protected  ServiceStatistics stats
          Deprecated.  
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Startable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Stoppable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Fields inherited from interface org.mule.api.AnnotatedObject
PROPERTY_NAME
 
Constructor Summary
AbstractService(MuleContext muleContext)
          Deprecated.  
 
Method Summary
protected abstract  void addMessageProcessors(MessageProcessorChainBuilder builder)
          Deprecated.  
protected  void buildServiceMessageProcessorChain()
          Deprecated.  
protected  ServiceAsyncRequestReplyRequestor createAsyncReplyProcessor()
          Deprecated.  
protected  ServiceStatistics createStatistics()
          Deprecated.  
 void dispatchEvent(MuleEvent event)
          Deprecated. 
 void dispose()
          Deprecated. A lifecycle method where implementor should free up any resources.
protected  void disposeIfDisposable(Object candidate)
          Deprecated.  
protected  void doDispose()
          Deprecated.  
protected  void doForceStop()
          Deprecated.  
protected  void doInitialise()
          Deprecated.  
protected  void doPause()
          Deprecated. Custom components can execute code necessary to put the service in a paused state here.
protected  void doResume()
          Deprecated. Custom components can execute code necessary to resume a service once it has been paused If a developer overloads this method the doPause() method MUST also be overloaded to avoid inconsistent state in the service
protected  void doStart()
          Deprecated.  
protected  void doStop()
          Deprecated.  
 void forceStop()
          Deprecated.  
 Object getAnnotation(QName name)
          Deprecated. Gets the value of specified annotation.
 Map<QName,Object> getAnnotations()
          Deprecated. Gets all annotations.
 ServiceAsyncReplyCompositeMessageSource getAsyncReplyMessageSource()
          Deprecated.  
protected  long getAsyncReplyTimeout()
          Deprecated.  
 Component getComponent()
          Deprecated. Returns the Component that is a invoked by a Service for each incoming MuleEvent routed on by the inbound routers.
 MessagingExceptionHandler getExceptionListener()
          Deprecated.  
 String getInitialState()
          Deprecated. Returns the initial state of this service
 LifecycleManager getLifecycleManager()
          Deprecated.  
 LifecycleState getLifecycleState()
          Deprecated.  
 MessageInfoMapping getMessageInfoMapping()
          Deprecated.  
 MessageProcessorChain getMessageProcessorChain()
          Deprecated.  
 MessageSource getMessageSource()
          Deprecated.  
 Model getModel()
          Deprecated. Returns the name of the model that this descriptor is registered with.
 MuleContext getMuleContext()
          Deprecated.  
 String getName()
          Deprecated. Gets the name of the object
 MessageProcessor getOutboundMessageProcessor()
          Deprecated. Outbound Routers control how events are published by a service once.
protected  MessageProcessor getServiceStartedAssertingMessageProcessor()
          Deprecated.  
 ServiceStatistics getStatistics()
          Deprecated. Returns the Service statistics.
 void initialise()
          Deprecated. Initialise the service.
protected  void initialiseIfInitialisable(Object candidate)
          Deprecated.  
protected  void injectFlowConstructMuleContext(Object candidate)
          Deprecated.  
 boolean isPaused()
          Deprecated. Determines if the service is in a paused state
 boolean isStarted()
          Deprecated. Determines whether this service has been started
 boolean isStopped()
          Deprecated.  
 boolean isStopping()
          Deprecated.  
 void pause()
          Deprecated. Pauses event processing for a single Mule Service.
protected  void pauseIfPausable(Object candidate)
          Deprecated.  
 MuleEvent process(MuleEvent event)
          Deprecated. Invokes the MessageProcessor.
 void resume()
          Deprecated. Resumes a single Mule Service that has been paused.
protected  void resumeIfResumable(Object candidate)
          Deprecated.  
 MuleEvent sendEvent(MuleEvent event)
          Deprecated. 
 void setAnnotations(Map<QName,Object> newAnnotations)
          Deprecated. Sets annotations to the object.
 void setAsyncReplyMessageSource(ServiceAsyncReplyCompositeMessageSource asyncReplyMessageSource)
          Deprecated.  
 void setComponent(Component component)
          Deprecated. Sets the Component that is a invoked by a Service for each incoming MuleEvent routed on by the inbound routers.
 void setExceptionListener(MessagingExceptionHandler exceptionListener)
          Deprecated.  
 void setInitialState(String initialState)
          Deprecated. Sets the initial state of this service
 void setMessageInfoMapping(MessageInfoMapping messageInfoMapping)
          Deprecated.  
 void setMessageProcessor(MessageProcessor processor)
          Deprecated. 
 void setMessageSource(MessageSource inboundMessageSource)
          Deprecated.  
 void setModel(Model model)
          Deprecated.  
 void setName(String name)
          Deprecated. Sets the name of the object
 void setOutboundMessageProcessor(MessageProcessor processor)
          Deprecated. Outbound message processor controls how events are published by a service once the event has been processed.
 void start()
          Deprecated.  
protected  void startIfStartable(Object candidate)
          Deprecated.  
 void stop()
          Deprecated.  
protected  void stopIfStoppable(Object candidate)
          Deprecated.  
 String toString()
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected transient Log logger
Deprecated. 
logger used by this class


stats

protected ServiceStatistics stats
Deprecated. 

model

protected Model model
Deprecated. 
The model in which this service is registered


muleContext

protected MuleContext muleContext
Deprecated. 

lifecycleManager

protected ServiceLifecycleManager lifecycleManager
Deprecated. 

INITIAL_STATE_STOPPED

public static final String INITIAL_STATE_STOPPED
Deprecated. 
The initial states that the service can be started in

See Also:
Constant Field Values

INITIAL_STATE_STARTED

public static final String INITIAL_STATE_STARTED
Deprecated. 
See Also:
Constant Field Values

INITIAL_STATE_PAUSED

public static final String INITIAL_STATE_PAUSED
Deprecated. 
See Also:
Constant Field Values

exceptionListener

protected MessagingExceptionHandler exceptionListener
Deprecated. 
The exception strategy used by the service.


name

protected String name
Deprecated. 
The service's name


outboundRouter

protected MessageProcessor outboundRouter
Deprecated. 

messageSource

protected MessageSource messageSource
Deprecated. 

asyncReplyMessageSource

protected ServiceAsyncReplyCompositeMessageSource asyncReplyMessageSource
Deprecated. 

messageProcessorChain

protected MessageProcessorChain messageProcessorChain
Deprecated. 

messageInfoMapping

protected MessageInfoMapping messageInfoMapping
Deprecated. 

initialState

protected String initialState
Deprecated. 
Determines the initial state of this service when the model starts. Can be 'stopped' or 'started' (default)


component

protected Component component
Deprecated. 
Constructor Detail

AbstractService

public AbstractService(MuleContext muleContext)
Deprecated. 
Method Detail

initialise

public final void initialise()
                      throws InitialisationException
Deprecated. 
Initialise the service. The service will first create a component from the ServiceDescriptor and then initialise a pool based on the attributes in the ServiceDescriptor .

Specified by:
initialise in interface Initialisable
Throws:
InitialisationException - if the service fails to initialise
RecoverableException - if an error occurs that can be recovered from
See Also:
ServiceDescriptor

start

public void start()
           throws MuleException
Deprecated. 
Specified by:
start in interface Startable
Throws:
MuleException

pause

public final void pause()
                 throws MuleException
Deprecated. 
Pauses event processing for a single Mule Service. Unlike stop(), a paused service will still consume messages from the underlying transport, but those messages will be queued until the service is resumed.

Specified by:
pause in interface Service
Throws:
MuleException

resume

public final void resume()
                  throws MuleException
Deprecated. 
Resumes a single Mule Service that has been paused. If the service is not paused nothing is executed.

Specified by:
resume in interface Service
Throws:
MuleException

stop

public void stop()
          throws MuleException
Deprecated. 
Specified by:
stop in interface Stoppable
Throws:
MuleException

dispose

public final void dispose()
Deprecated. 
Description copied from interface: Disposable
A lifecycle method where implementor should free up any resources. If an exception is thrown it should just be logged and processing should continue. This method should not throw Runtime exceptions.

Specified by:
dispose in interface Disposable

getLifecycleState

public LifecycleState getLifecycleState()
Deprecated. 
Specified by:
getLifecycleState in interface LifecycleStateEnabled

isStarted

public boolean isStarted()
Deprecated. 
Description copied from interface: Service
Determines whether this service has been started

Specified by:
isStarted in interface Service
Returns:
true is the service is started and ready to receive events

isPaused

public boolean isPaused()
Deprecated. 
Determines if the service is in a paused state

Specified by:
isPaused in interface Service
Returns:
True if the service is in a paused state, false otherwise

isStopped

public boolean isStopped()
Deprecated. 
Specified by:
isStopped in interface Service

isStopping

public boolean isStopping()
Deprecated. 

doPause

protected void doPause()
                throws MuleException
Deprecated. 
Custom components can execute code necessary to put the service in a paused state here. If a developer overloads this method the doResume() method MUST also be overloaded to avoid inconsistent state in the service

Throws:
MuleException

doResume

protected void doResume()
                 throws MuleException
Deprecated. 
Custom components can execute code necessary to resume a service once it has been paused If a developer overloads this method the doPause() method MUST also be overloaded to avoid inconsistent state in the service

Throws:
MuleException

doForceStop

protected void doForceStop()
                    throws MuleException
Deprecated. 
Throws:
MuleException

doStop

protected void doStop()
               throws MuleException
Deprecated. 
Throws:
MuleException

doStart

protected void doStart()
                throws MuleException
Deprecated. 
Throws:
MuleException

doDispose

protected void doDispose()
Deprecated. 

doInitialise

protected void doInitialise()
                     throws InitialisationException
Deprecated. 
Throws:
InitialisationException

forceStop

public void forceStop()
               throws MuleException
Deprecated. 
Throws:
MuleException

buildServiceMessageProcessorChain

protected void buildServiceMessageProcessorChain()
                                          throws MuleException
Deprecated. 
Throws:
MuleException

getServiceStartedAssertingMessageProcessor

protected MessageProcessor getServiceStartedAssertingMessageProcessor()
Deprecated. 

addMessageProcessors

protected abstract void addMessageProcessors(MessageProcessorChainBuilder builder)
Deprecated. 

createStatistics

protected ServiceStatistics createStatistics()
Deprecated. 

getStatistics

public ServiceStatistics getStatistics()
Deprecated. 
Description copied from interface: Service
Returns the Service statistics. This provides Service router and component statistics.

Specified by:
getStatistics in interface FlowConstruct
Specified by:
getStatistics in interface Service
Returns:
The statistics holder used by this flow construct to keep track of its activity.

dispatchEvent

@Deprecated
public void dispatchEvent(MuleEvent event)
                   throws MuleException
Deprecated. 

Description copied from interface: Service
Makes an asynchronous event call to the service.

Specified by:
dispatchEvent in interface Service
Parameters:
event - the event to consume
Throws:
MuleException - if the event fails to be processed

sendEvent

@Deprecated
public MuleEvent sendEvent(MuleEvent event)
                    throws MuleException
Deprecated. 

Description copied from interface: Service
Makes a synchronous event call to the service. This event will be consumed by the service and a result returned.

Specified by:
sendEvent in interface Service
Parameters:
event - the event to consume
Returns:
a MuleMessage containing the resulting message and properties
Throws:
MuleException - if the event fails to be processed

getName

public String getName()
Deprecated. 
Description copied from interface: NamedObject
Gets the name of the object

Specified by:
getName in interface NamedObject
Returns:
the Mule descriptor name which is associated with the service

toString

public String toString()
Deprecated. 
Overrides:
toString in class Object

getModel

public Model getModel()
Deprecated. 
Description copied from interface: Service
Returns the name of the model that this descriptor is registered with.

Specified by:
getModel in interface Service
Returns:
the name of the model that this descriptor is registered with or null if this descriptor has not been registered with a model yet

setModel

public void setModel(Model model)
Deprecated. 
Specified by:
setModel in interface Service

getExceptionListener

public MessagingExceptionHandler getExceptionListener()
Deprecated. 
Specified by:
getExceptionListener in interface FlowConstruct
Specified by:
getExceptionListener in interface Service
Returns:
The exception listener that will be used to handle exceptions that may be thrown at different points during the message flow defined by this construct.

setExceptionListener

public void setExceptionListener(MessagingExceptionHandler exceptionListener)
Deprecated. 
Specified by:
setExceptionListener in interface Service

getMessageSource

public MessageSource getMessageSource()
Deprecated. 
Specified by:
getMessageSource in interface Service

setMessageSource

public void setMessageSource(MessageSource inboundMessageSource)
Deprecated. 
Specified by:
setMessageSource in interface Service

getOutboundMessageProcessor

public MessageProcessor getOutboundMessageProcessor()
Deprecated. 
Description copied from interface: Service
Outbound Routers control how events are published by a service once. the event has been processed. If no router is set. A default will be used that uses the outboundProvider set on his descriptor to route the event.

Specified by:
getOutboundMessageProcessor in interface Service
Returns:
the outbound router for this service
See Also:
OutboundRouterCollection

setMessageProcessor

@Deprecated
public void setMessageProcessor(MessageProcessor processor)
Deprecated. 


setOutboundMessageProcessor

public void setOutboundMessageProcessor(MessageProcessor processor)
Deprecated. 
Description copied from interface: Service
Outbound message processor controls how events are published by a service once the event has been processed. If no router is set a default will be used that uses the outboundProvider set on his descriptor to route the event.

Specified by:
setOutboundMessageProcessor in interface Service

getAsyncReplyMessageSource

public ServiceAsyncReplyCompositeMessageSource getAsyncReplyMessageSource()
Deprecated. 
Specified by:
getAsyncReplyMessageSource in interface Service

setAsyncReplyMessageSource

public void setAsyncReplyMessageSource(ServiceAsyncReplyCompositeMessageSource asyncReplyMessageSource)
Deprecated. 
Specified by:
setAsyncReplyMessageSource in interface Service

getInitialState

public String getInitialState()
Deprecated. 
Description copied from interface: Service
Returns the initial state of this service

Specified by:
getInitialState in interface Service
Returns:
the initial state of this service

setInitialState

public void setInitialState(String initialState)
Deprecated. 
Description copied from interface: Service
Sets the initial state of this service

Specified by:
setInitialState in interface Service
Parameters:
initialState - the initial state of this service

setName

public void setName(String name)
Deprecated. 
Description copied from interface: NameableObject
Sets the name of the object

Specified by:
setName in interface NameableObject
Parameters:
name - the name of the object

getComponent

public Component getComponent()
Deprecated. 
Description copied from interface: Service
Returns the Component that is a invoked by a Service for each incoming MuleEvent routed on by the inbound routers.

Specified by:
getComponent in interface Service

setComponent

public void setComponent(Component component)
Deprecated. 
Description copied from interface: Service
Sets the Component that is a invoked by a Service for each incoming MuleEvent routed on by the inbound routers.

Specified by:
setComponent in interface Service

getMuleContext

public MuleContext getMuleContext()
Deprecated. 
Specified by:
getMuleContext in interface FlowConstruct
Specified by:
getMuleContext in interface Service
Returns:
This muleContext that this flow construct belongs to and runs in the context of.

getLifecycleManager

public LifecycleManager getLifecycleManager()
Deprecated. 
Specified by:
getLifecycleManager in interface Service

getMessageInfoMapping

public MessageInfoMapping getMessageInfoMapping()
Deprecated. 
Specified by:
getMessageInfoMapping in interface FlowConstruct
Returns:
This implementation of MessageInfoMapping used to control how Important message information is pulled from the current message.

setMessageInfoMapping

public void setMessageInfoMapping(MessageInfoMapping messageInfoMapping)
Deprecated. 

getAsyncReplyTimeout

protected long getAsyncReplyTimeout()
Deprecated. 

createAsyncReplyProcessor

protected ServiceAsyncRequestReplyRequestor createAsyncReplyProcessor()
Deprecated. 

process

public MuleEvent process(MuleEvent event)
                  throws MuleException
Deprecated. 
Description copied from interface: MessageProcessor
Invokes the MessageProcessor.

Specified by:
process in interface MessageProcessor
Parameters:
event - MuleEvent to be processed
Returns:
optional response MuleEvent
Throws:
MuleException

getMessageProcessorChain

public MessageProcessorChain getMessageProcessorChain()
Deprecated. 

injectFlowConstructMuleContext

protected void injectFlowConstructMuleContext(Object candidate)
Deprecated. 

initialiseIfInitialisable

protected void initialiseIfInitialisable(Object candidate)
                                  throws InitialisationException
Deprecated. 
Throws:
InitialisationException

startIfStartable

protected void startIfStartable(Object candidate)
                         throws MuleException
Deprecated. 
Throws:
MuleException

stopIfStoppable

protected void stopIfStoppable(Object candidate)
                        throws MuleException
Deprecated. 
Throws:
MuleException

disposeIfDisposable

protected void disposeIfDisposable(Object candidate)
Deprecated. 

pauseIfPausable

protected void pauseIfPausable(Object candidate)
                        throws MuleException
Deprecated. 
Throws:
MuleException

resumeIfResumable

protected void resumeIfResumable(Object candidate)
                          throws MuleException
Deprecated. 
Throws:
MuleException

getAnnotation

public final Object getAnnotation(QName name)
Deprecated. 
Description copied from interface: AnnotatedObject
Gets the value of specified annotation.

Specified by:
getAnnotation in interface AnnotatedObject
Returns:
the value of specified annotation

getAnnotations

public final Map<QName,Object> getAnnotations()
Deprecated. 
Description copied from interface: AnnotatedObject
Gets all annotations.

Specified by:
getAnnotations in interface AnnotatedObject
Returns:
all annotation

setAnnotations

public final void setAnnotations(Map<QName,Object> newAnnotations)
Deprecated. 
Description copied from interface: AnnotatedObject
Sets annotations to the object.

Specified by:
setAnnotations in interface AnnotatedObject


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.