Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mule.service
Class AbstractService

    java.lang.Object
      org.mule.service.AbstractService

All Implemented Interfaces:
  Serializable, FlowConstruct, Disposable, Initialisable, Lifecycle, LifecycleStateEnabled, Startable, Stoppable, NamedObject, MessageProcessor, Service

Direct Known Subclasses:
  JcaService, SedaService

    public abstract class AbstractService

extends Object
implements Service, MessageProcessor

A base implementation for all Services in Mule

See Also:
  Serialized Form

Field Summary
`protected ServiceAsyncReplyCompositeMessageSource` | `asyncReplyMessageSource`
`protected Component` | `component`
`protected MessagingExceptionHandler` | `exceptionListener` The exception strategy used by the service.
`static String` | `INITIAL_STATE_PAUSED`
`static String` | `INITIAL_STATE_STARTED`
`static String` | `INITIAL_STATE_STOPPED` The initial states that the service can be started in
`protected String` | `initialState` Determines the initial state of this service when the model starts.
`protected ServiceLifecycleManager` | `lifecycleManager`
`protected Log` | `logger` logger used by this class
`protected MessageInfoMapping` | `messageInfoMapping`
`protected MessageProcessorChain` | `messageProcessorChain`
`protected MessageSource` | `messageSource`
`protected Model` | `model` The model in which this service is registered
`protected MuleContext` | `muleContext`
`protected String` | `name` The service's name
`protected MessageProcessor` | `outboundRouter`
`protected ServiceStatistics` | `stats`

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`

Constructor Summary
`AbstractService(MuleContext muleContext)`

Method Summary
`protected abstract void` | `addMessageProcessors(MessageProcessorChainBuilder builder)`
`protected void` | `buildServiceMessageProcessorChain()`
`protected ServiceAsyncRequestReplyRequestor` | `createAsyncReplyProcessor()`
`protected ServiceStatistics` | `createStatistics()`
`void` | `dispatchEvent(MuleEvent event)` Deprecated.
`void` | `dispose()` A lifecycle method where implementor should free up any resources.
`protected void` | `disposeIfDisposable(Object candidate)`
`protected void` | `doDispose()`
`protected void` | `doForceStop()`
`protected void` | `doInitialise()`
`protected void` | `doPause()` Custom components can execute code necessary to put the service in a paused state here.
`protected void` | `doResume()` 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()`
`protected void` | `doStop()`
`void` | `forceStop()`
`ServiceAsyncReplyCompositeMessageSource` | `getAsyncReplyMessageSource()`
`protected long` | `getAsyncReplyTimeout()`
`Component` | `getComponent()` Returns the Component that is a invoked by a `Service` for each incoming `MuleEvent` routed on by the `InboundRouterCollection`.
`MessagingExceptionHandler` | `getExceptionListener()`
`String` | `getInitialState()` Returns the initial state of this service
`LifecycleManager` | `getLifecycleManager()`
`LifecycleState` | `getLifecycleState()`
`MessageInfoMapping` | `getMessageInfoMapping()`
`MessageProcessorChain` | `getMessageProcessorChain()`
`MessageSource` | `getMessageSource()`
`Model` | `getModel()` Returns the name of the model that this descriptor is registered with.
`MuleContext` | `getMuleContext()`
`String` | `getName()` Gets the name of the object
`MessageProcessor` | `getOutboundMessageProcessor()` Outbound Routers control how events are published by a service once.
`protected MessageProcessor` | `getServiceStartedAssertingMessageProcessor()`
`ServiceStatistics` | `getStatistics()` Returns the Service statistics.
`void` | `initialise()` Initialise the service.
`protected void` | `initialiseIfInitialisable(Object candidate)`
`protected void` | `injectFlowConstructMuleContext(Object candidate)`
`boolean` | `isPaused()` Determines if the service is in a paused state
`boolean` | `isStarted()` Determines whether this service has been started
`boolean` | `isStopped()`
`boolean` | `isStopping()`
`void` | `pause()` Pauses event processing for a single Mule Service.
`MuleEvent` | `process(MuleEvent event)` Invokes the MessageProcessor.
`void` | `resume()` Resumes a single Mule Service that has been paused.
`MuleEvent` | `sendEvent(MuleEvent event)` Deprecated.
`void` | `setAsyncReplyMessageSource(ServiceAsyncReplyCompositeMessageSource asyncReplyMessageSource)`
`void` | `setComponent(Component component)` Sets the Component that is a invoked by a `Service` for each incoming `MuleEvent` routed on by the `InboundRouterCollection`.
`void` | `setExceptionListener(MessagingExceptionHandler exceptionListener)`
`void` | `setInitialState(String initialState)` Sets the initial state of this service
`void` | `setMessageInfoMapping(MessageInfoMapping messageInfoMapping)`
`void` | `setMessageProcessor(MessageProcessor processor)` Deprecated.
`void` | `setMessageSource(MessageSource inboundMessageSource)`
`void` | `setModel(Model model)`
`void` | `setName(String name)` Sets the name of the object
`void` | `setOutboundMessageProcessor(MessageProcessor processor)` Outbound Routers control how events are published by a service once.
`void` | `start()`
`protected void` | `startIfStartable(Object candidate)`
`void` | `stop()`
`protected void` | `stopIfStoppable(Object candidate)`
`String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### logger

    protected transient Log logger

  logger used by this class

### stats

    protected ServiceStatistics stats

### model

    protected Model model

  The model in which this service is registered

### muleContext

    protected MuleContext muleContext

### lifecycleManager

    protected ServiceLifecycleManager lifecycleManager

### INITIAL_STATE_STOPPED

    public static final String INITIAL_STATE_STOPPED

  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

See Also:
  Constant Field Values

### INITIAL_STATE_PAUSED

    public static final String INITIAL_STATE_PAUSED

See Also:
  Constant Field Values

### exceptionListener

    protected MessagingExceptionHandler exceptionListener

  The exception strategy used by the service.

### name

    protected String name

  The service's name

### outboundRouter

    protected MessageProcessor outboundRouter

### messageSource

    protected MessageSource messageSource

### asyncReplyMessageSource

    protected ServiceAsyncReplyCompositeMessageSource asyncReplyMessageSource

### messageProcessorChain

    protected MessageProcessorChain messageProcessorChain

### messageInfoMapping

    protected MessageInfoMapping messageInfoMapping

### initialState

    protected String initialState

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

### component

    protected Component component

Constructor Detail

### AbstractService

    public AbstractService(MuleContext muleContext)

Method Detail

### initialise

    public final void initialise()
                          throws InitialisationException

  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

  Specified by:
    `start` in interface `Startable`
  Throws:
    `MuleException`

### pause

    public final void pause()
                     throws MuleException

  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

  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

  Specified by:
    `stop` in interface `Stoppable`
  Throws:
    `MuleException`

### dispose

    public final void dispose()

  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()

  Specified by:
    `getLifecycleState` in interface `LifecycleStateEnabled`

### isStarted

    public boolean isStarted()

  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()

  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()

  Specified by:
    `isStopped` in interface `Service`

### isStopping

    public boolean isStopping()

### doPause

    protected void doPause()
                    throws MuleException

  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

  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

  Throws:
    `MuleException`

### doStop

    protected void doStop()
                   throws MuleException

  Throws:
    `MuleException`

### doStart

    protected void doStart()
                    throws MuleException

  Throws:
    `MuleException`

### doDispose

    protected void doDispose()

### doInitialise

    protected void doInitialise()
                         throws InitialisationException

  Throws:
    `InitialisationException`

### forceStop

    public void forceStop()
                   throws MuleException

  Throws:
    `MuleException`

### buildServiceMessageProcessorChain

    protected void buildServiceMessageProcessorChain()
                                              throws MuleException

  Throws:
    `MuleException`

### getServiceStartedAssertingMessageProcessor

    protected MessageProcessor getServiceStartedAssertingMessageProcessor()

### addMessageProcessors

    protected abstract void addMessageProcessors(MessageProcessorChainBuilder builder)

### createStatistics

    protected ServiceStatistics createStatistics()

### getStatistics

    public ServiceStatistics getStatistics()

  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()

  Description copied from interface: `NamedObject`
  Gets the name of the object

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

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

### getModel

    public Model getModel()

  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)

  Specified by:
    `setModel` in interface `Service`

### getExceptionListener

    public MessagingExceptionHandler getExceptionListener()

  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)

  Specified by:
    `setExceptionListener` in interface `Service`

### getMessageSource

    public MessageSource getMessageSource()

  Specified by:
    `getMessageSource` in interface `Service`

### setMessageSource

    public void setMessageSource(MessageSource inboundMessageSource)

  Specified by:
    `setMessageSource` in interface `Service`

### getOutboundMessageProcessor

    public MessageProcessor getOutboundMessageProcessor()

  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)

  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:
    `setOutboundMessageProcessor` in interface `Service`
  See Also:
    `OutboundRouterCollection`

### getAsyncReplyMessageSource

    public ServiceAsyncReplyCompositeMessageSource getAsyncReplyMessageSource()

  Specified by:
    `getAsyncReplyMessageSource` in interface `Service`

### setAsyncReplyMessageSource

    public void setAsyncReplyMessageSource(ServiceAsyncReplyCompositeMessageSource asyncReplyMessageSource)

  Specified by:
    `setAsyncReplyMessageSource` in interface `Service`

### getInitialState

    public String getInitialState()

  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)

  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)

  Description copied from interface: `NamedObject`
  Sets the name of the object

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

### getComponent

    public Component getComponent()

  Description copied from interface: `Service`
  Returns the Component that is a invoked by a `Service` for each incoming `MuleEvent` routed on by the `InboundRouterCollection`.

  Specified by:
    `getComponent` in interface `Service`

### setComponent

    public void setComponent(Component component)

  Description copied from interface: `Service`
  Sets the Component that is a invoked by a `Service` for each incoming `MuleEvent` routed on by the `InboundRouterCollection`.

  Specified by:
    `setComponent` in interface `Service`

### getMuleContext

    public MuleContext getMuleContext()

  Specified by:
    `getMuleContext` in interface `Service`

### getLifecycleManager

    public LifecycleManager getLifecycleManager()

  Specified by:
    `getLifecycleManager` in interface `Service`

### getMessageInfoMapping

    public MessageInfoMapping getMessageInfoMapping()

  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)

### getAsyncReplyTimeout

    protected long getAsyncReplyTimeout()

### createAsyncReplyProcessor

    protected ServiceAsyncRequestReplyRequestor createAsyncReplyProcessor()

### process

    public MuleEvent process(MuleEvent event)
                      throws MuleException

  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()

  Specified by:
    `getMessageProcessorChain` in interface `FlowConstruct`

### injectFlowConstructMuleContext

    protected void injectFlowConstructMuleContext(Object candidate)

### initialiseIfInitialisable

    protected void initialiseIfInitialisable(Object candidate)
                                      throws InitialisationException

  Throws:
    `InitialisationException`

### startIfStartable

    protected void startIfStartable(Object candidate)
                             throws MuleException

  Throws:
    `MuleException`

### stopIfStoppable

    protected void stopIfStoppable(Object candidate)
                            throws MuleException

  Throws:
    `MuleException`

### disposeIfDisposable

    protected void disposeIfDisposable(Object candidate)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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