|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mule.service.AbstractService
public abstract class AbstractService
A base implementation for all Services in Mule
| 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 |
|---|
protected transient Log logger
protected ServiceStatistics stats
protected Model model
protected MuleContext muleContext
protected ServiceLifecycleManager lifecycleManager
public static final String INITIAL_STATE_STOPPED
public static final String INITIAL_STATE_STARTED
public static final String INITIAL_STATE_PAUSED
protected MessagingExceptionHandler exceptionListener
protected String name
protected MessageProcessor outboundRouter
protected MessageSource messageSource
protected ServiceAsyncReplyCompositeMessageSource asyncReplyMessageSource
protected MessageProcessorChain messageProcessorChain
protected MessageInfoMapping messageInfoMapping
protected String initialState
protected Component component
| Constructor Detail |
|---|
public AbstractService(MuleContext muleContext)
| Method Detail |
|---|
public final void initialise()
throws InitialisationException
initialise in interface InitialisableInitialisationException - if the service fails to
initialise
RecoverableException - if an error occurs that can be recovered fromServiceDescriptor
public void start()
throws MuleException
start in interface StartableMuleException
public final void pause()
throws MuleException
pause in interface ServiceMuleException
public final void resume()
throws MuleException
resume in interface ServiceMuleException
public void stop()
throws MuleException
stop in interface StoppableMuleExceptionpublic final void dispose()
Disposable
dispose in interface Disposablepublic LifecycleState getLifecycleState()
getLifecycleState in interface LifecycleStateEnabledpublic boolean isStarted()
Service
isStarted in interface Servicepublic boolean isPaused()
isPaused in interface Servicepublic boolean isStopped()
isStopped in interface Servicepublic boolean isStopping()
protected void doPause()
throws MuleException
MuleException
protected void doResume()
throws MuleException
MuleException
protected void doForceStop()
throws MuleException
MuleException
protected void doStop()
throws MuleException
MuleException
protected void doStart()
throws MuleException
MuleExceptionprotected void doDispose()
protected void doInitialise()
throws InitialisationException
InitialisationException
public void forceStop()
throws MuleException
MuleException
protected void buildServiceMessageProcessorChain()
throws MuleException
MuleExceptionprotected MessageProcessor getServiceStartedAssertingMessageProcessor()
protected abstract void addMessageProcessors(MessageProcessorChainBuilder builder)
protected ServiceStatistics createStatistics()
public ServiceStatistics getStatistics()
Service
getStatistics in interface FlowConstructgetStatistics in interface Service
@Deprecated
public void dispatchEvent(MuleEvent event)
throws MuleException
Service
dispatchEvent in interface Serviceevent - the event to consume
MuleException - if the event fails to be processed
@Deprecated
public MuleEvent sendEvent(MuleEvent event)
throws MuleException
Service
sendEvent in interface Serviceevent - the event to consume
MuleException - if the event fails to be processedpublic String getName()
NamedObject
getName in interface FlowConstructgetName in interface NamedObjectpublic String toString()
toString in class Objectpublic Model getModel()
Service
getModel in interface Servicepublic void setModel(Model model)
setModel in interface Servicepublic MessagingExceptionHandler getExceptionListener()
getExceptionListener in interface FlowConstructgetExceptionListener in interface Servicepublic void setExceptionListener(MessagingExceptionHandler exceptionListener)
setExceptionListener in interface Servicepublic MessageSource getMessageSource()
getMessageSource in interface Servicepublic void setMessageSource(MessageSource inboundMessageSource)
setMessageSource in interface Servicepublic MessageProcessor getOutboundMessageProcessor()
Service
getOutboundMessageProcessor in interface ServiceOutboundRouterCollection@Deprecated public void setMessageProcessor(MessageProcessor processor)
public void setOutboundMessageProcessor(MessageProcessor processor)
Service
setOutboundMessageProcessor in interface ServiceOutboundRouterCollectionpublic ServiceAsyncReplyCompositeMessageSource getAsyncReplyMessageSource()
getAsyncReplyMessageSource in interface Servicepublic void setAsyncReplyMessageSource(ServiceAsyncReplyCompositeMessageSource asyncReplyMessageSource)
setAsyncReplyMessageSource in interface Servicepublic String getInitialState()
Service
getInitialState in interface Servicepublic void setInitialState(String initialState)
Service
setInitialState in interface ServiceinitialState - the initial state of this servicepublic void setName(String name)
NamedObject
setName in interface NamedObjectname - the name of the objectpublic Component getComponent()
ServiceService for each incoming
MuleEvent routed on by the InboundRouterCollection.
getComponent in interface Servicepublic void setComponent(Component component)
ServiceService for each incoming
MuleEvent routed on by the InboundRouterCollection.
setComponent in interface Servicepublic MuleContext getMuleContext()
getMuleContext in interface Servicepublic LifecycleManager getLifecycleManager()
getLifecycleManager in interface Servicepublic MessageInfoMapping getMessageInfoMapping()
getMessageInfoMapping in interface FlowConstructMessageInfoMapping used to control how
Important message information is pulled from the current message.public void setMessageInfoMapping(MessageInfoMapping messageInfoMapping)
protected long getAsyncReplyTimeout()
protected ServiceAsyncRequestReplyRequestor createAsyncReplyProcessor()
public MuleEvent process(MuleEvent event)
throws MuleException
MessageProcessor
process in interface MessageProcessorevent - MuleEvent to be processed
MuleExceptionpublic MessageProcessorChain getMessageProcessorChain()
getMessageProcessorChain in interface FlowConstructprotected void injectFlowConstructMuleContext(Object candidate)
protected void initialiseIfInitialisable(Object candidate)
throws InitialisationException
InitialisationException
protected void startIfStartable(Object candidate)
throws MuleException
MuleException
protected void stopIfStoppable(Object candidate)
throws MuleException
MuleExceptionprotected void disposeIfDisposable(Object candidate)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||