org.mule.api.service
Interface Service

All Superinterfaces:
Disposable, FlowConstruct, Initialisable, Lifecycle, LifecycleStateEnabled, NameableObject, NamedObject, Serializable, Startable, Stoppable
All Known Implementing Classes:
AbstractService, JcaService, SedaService

public interface Service
extends Serializable, FlowConstruct, Lifecycle, NameableObject

Service is the internal representation of a Mule Managed service. It is responsible for managing the interaction of events to and from the service as well as managing pooled resources.


Field Summary
 
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
 
Method Summary
 void dispatchEvent(MuleEvent event)
          Deprecated.  
 ServiceAsyncReplyCompositeMessageSource getAsyncReplyMessageSource()
           
 Component getComponent()
          Returns the Component that is a invoked by a Service for each incoming MuleEvent routed on by the inbound routers.
 MessagingExceptionHandler getExceptionListener()
           
 String getInitialState()
          Returns the initial state of this service
 LifecycleManager getLifecycleManager()
           
 MessageSource getMessageSource()
           
 Model getModel()
          Returns the name of the model that this descriptor is registered with.
 MuleContext getMuleContext()
           
 MessageProcessor getOutboundMessageProcessor()
          Outbound Routers control how events are published by a service once.
 ServiceStatistics getStatistics()
          Returns the Service statistics.
 boolean isPaused()
           
 boolean isStarted()
          Determines whether this service has been started
 boolean isStopped()
           
 void pause()
          Pauses event processing for a single Mule Service.
 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 inbound routers.
 void setExceptionListener(MessagingExceptionHandler exceptionListener)
           
 void setInitialState(String state)
          Sets the initial state of this service
 void setMessageSource(MessageSource messageSource)
           
 void setModel(Model model)
           
 void setOutboundMessageProcessor(MessageProcessor processor)
          Outbound message processor controls how events are published by a service once the event has been processed.
 
Methods inherited from interface org.mule.api.construct.FlowConstruct
getMessageInfoMapping
 
Methods inherited from interface org.mule.api.lifecycle.LifecycleStateEnabled
getLifecycleState
 
Methods inherited from interface org.mule.api.lifecycle.Initialisable
initialise
 
Methods inherited from interface org.mule.api.lifecycle.Startable
start
 
Methods inherited from interface org.mule.api.lifecycle.Stoppable
stop
 
Methods inherited from interface org.mule.api.lifecycle.Disposable
dispose
 
Methods inherited from interface org.mule.api.NameableObject
setName
 
Methods inherited from interface org.mule.api.NamedObject
getName
 

Method Detail

dispatchEvent

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

Makes an asynchronous event call to the service.

Parameters:
event - the event to consume
Throws:
MuleException - if the event fails to be processed

sendEvent

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

Makes a synchronous event call to the service. This event will be consumed by the service and a result returned.

Parameters:
event - the event to consume
Returns:
a MuleMessage containing the resulting message and properties
Throws:
MuleException - if the event fails to be processed

isStarted

boolean isStarted()
Determines whether this service has been started

Returns:
true is the service is started and ready to receive events

isStopped

boolean isStopped()

pause

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.

Throws:
MuleException

resume

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

Throws:
MuleException

isPaused

boolean isPaused()
Returns:
true if the service is in a paused state, false otherwise

getMessageSource

MessageSource getMessageSource()

getOutboundMessageProcessor

MessageProcessor getOutboundMessageProcessor()
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.

Returns:
the outbound router for this service
See Also:
OutboundRouterCollection

getInitialState

String getInitialState()
Returns the initial state of this service

Returns:
the initial state of this service

getModel

Model getModel()
Returns the name of the model that this descriptor is registered with.

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

setMessageSource

void setMessageSource(MessageSource messageSource)

setOutboundMessageProcessor

void setOutboundMessageProcessor(MessageProcessor processor)
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.


setInitialState

void setInitialState(String state)
Sets the initial state of this service

Parameters:
state - the initial state of this service

setModel

void setModel(Model model)

getComponent

Component getComponent()
Returns the Component that is a invoked by a Service for each incoming MuleEvent routed on by the inbound routers.


setComponent

void setComponent(Component component)
Sets the Component that is a invoked by a Service for each incoming MuleEvent routed on by the inbound routers.


getStatistics

ServiceStatistics getStatistics()
Returns the Service statistics. This provides Service router and component statistics.

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

getMuleContext

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

getLifecycleManager

LifecycleManager getLifecycleManager()

setAsyncReplyMessageSource

void setAsyncReplyMessageSource(ServiceAsyncReplyCompositeMessageSource asyncReplyMessageSource)

getAsyncReplyMessageSource

ServiceAsyncReplyCompositeMessageSource getAsyncReplyMessageSource()

getExceptionListener

MessagingExceptionHandler getExceptionListener()
Specified by:
getExceptionListener in interface FlowConstruct
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

void setExceptionListener(MessagingExceptionHandler exceptionListener)


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