|
||||||||||
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 |
Fields inherited from interface org.mule.api.AnnotatedObject |
---|
PROPERTY_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()
|
Object |
getAnnotation(QName name)
Gets the value of specified annotation. |
Map<QName,Object> |
getAnnotations()
Gets all annotations. |
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 inbound routers. |
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. |
protected void |
pauseIfPausable(Object candidate)
|
MuleEvent |
process(MuleEvent event)
Invokes the MessageProcessor. |
void |
resume()
Resumes a single Mule Service that has been paused. |
protected void |
resumeIfResumable(Object candidate)
|
MuleEvent |
sendEvent(MuleEvent event)
Deprecated. |
void |
setAnnotations(Map<QName,Object> newAnnotations)
Sets annotations to the object. |
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 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 message processor controls how events are published by a service once the event has been processed. |
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 Initialisable
InitialisationException
- if the service fails to
initialise
RecoverableException
- if an error occurs that can be recovered fromServiceDescriptor
public void start() throws MuleException
start
in interface Startable
MuleException
public final void pause() throws MuleException
pause
in interface Service
MuleException
public final void resume() throws MuleException
resume
in interface Service
MuleException
public void stop() throws MuleException
stop
in interface Stoppable
MuleException
public final void dispose()
Disposable
dispose
in interface Disposable
public LifecycleState getLifecycleState()
getLifecycleState
in interface LifecycleStateEnabled
public boolean isStarted()
Service
isStarted
in interface Service
public boolean isPaused()
isPaused
in interface Service
public boolean isStopped()
isStopped
in interface Service
public 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
MuleException
protected void doDispose()
protected void doInitialise() throws InitialisationException
InitialisationException
public void forceStop() throws MuleException
MuleException
protected void buildServiceMessageProcessorChain() throws MuleException
MuleException
protected MessageProcessor getServiceStartedAssertingMessageProcessor()
protected abstract void addMessageProcessors(MessageProcessorChainBuilder builder)
protected ServiceStatistics createStatistics()
public ServiceStatistics getStatistics()
Service
getStatistics
in interface FlowConstruct
getStatistics
in interface Service
@Deprecated public void dispatchEvent(MuleEvent event) throws MuleException
Service
dispatchEvent
in interface Service
event
- the event to consume
MuleException
- if the event fails to be processed@Deprecated public MuleEvent sendEvent(MuleEvent event) throws MuleException
Service
sendEvent
in interface Service
event
- the event to consume
MuleException
- if the event fails to be processedpublic String getName()
NamedObject
getName
in interface NamedObject
public String toString()
toString
in class Object
public Model getModel()
Service
getModel
in interface Service
public void setModel(Model model)
setModel
in interface Service
public MessagingExceptionHandler getExceptionListener()
getExceptionListener
in interface FlowConstruct
getExceptionListener
in interface Service
public void setExceptionListener(MessagingExceptionHandler exceptionListener)
setExceptionListener
in interface Service
public MessageSource getMessageSource()
getMessageSource
in interface Service
public void setMessageSource(MessageSource inboundMessageSource)
setMessageSource
in interface Service
public MessageProcessor getOutboundMessageProcessor()
Service
getOutboundMessageProcessor
in interface Service
OutboundRouterCollection
@Deprecated public void setMessageProcessor(MessageProcessor processor)
public void setOutboundMessageProcessor(MessageProcessor processor)
Service
setOutboundMessageProcessor
in interface Service
public ServiceAsyncReplyCompositeMessageSource getAsyncReplyMessageSource()
getAsyncReplyMessageSource
in interface Service
public void setAsyncReplyMessageSource(ServiceAsyncReplyCompositeMessageSource asyncReplyMessageSource)
setAsyncReplyMessageSource
in interface Service
public String getInitialState()
Service
getInitialState
in interface Service
public void setInitialState(String initialState)
Service
setInitialState
in interface Service
initialState
- the initial state of this servicepublic void setName(String name)
NameableObject
setName
in interface NameableObject
name
- the name of the objectpublic Component getComponent()
Service
Service
for each incoming
MuleEvent
routed on by the inbound routers.
getComponent
in interface Service
public void setComponent(Component component)
Service
Service
for each incoming
MuleEvent
routed on by the inbound routers.
setComponent
in interface Service
public MuleContext getMuleContext()
getMuleContext
in interface FlowConstruct
getMuleContext
in interface Service
public LifecycleManager getLifecycleManager()
getLifecycleManager
in interface Service
public MessageInfoMapping getMessageInfoMapping()
getMessageInfoMapping
in interface FlowConstruct
MessageInfoMapping
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 MessageProcessor
event
- MuleEvent to be processed
MuleException
public MessageProcessorChain getMessageProcessorChain()
protected 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
MuleException
protected void disposeIfDisposable(Object candidate)
protected void pauseIfPausable(Object candidate) throws MuleException
MuleException
protected void resumeIfResumable(Object candidate) throws MuleException
MuleException
public final Object getAnnotation(QName name)
AnnotatedObject
getAnnotation
in interface AnnotatedObject
public final Map<QName,Object> getAnnotations()
AnnotatedObject
getAnnotations
in interface AnnotatedObject
public final void setAnnotations(Map<QName,Object> newAnnotations)
AnnotatedObject
setAnnotations
in interface AnnotatedObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |