org.mule.model.seda
Class SedaService
java.lang.Object
org.mule.service.AbstractService
org.mule.model.seda.SedaService
- All Implemented Interfaces:
- Serializable, Runnable, EventListener, javax.resource.spi.work.Work, javax.resource.spi.work.WorkListener, MuleContextAware, Disposable, Initialisable, Lifecycle, Startable, Stoppable, NamedObject, Service
public class SedaService
- extends AbstractService
- implements javax.resource.spi.work.Work, javax.resource.spi.work.WorkListener
A Seda service runs inside a Seda Model and is responsible for managing a Seda
Queue and thread pool for a Mule sevice service. In Seda terms this is
equivilent to a stage.
- See Also:
- Serialized Form
Fields inherited from class org.mule.service.AbstractService |
component, exceptionListener, inboundRouter, INITIAL_STATE_PAUSED, INITIAL_STATE_STARTED, INITIAL_STATE_STOPPED, initialised, initialState, logger, model, muleContext, name, outboundRouter, paused, responseRouter, stats, stopped, stopping |
Methods inherited from class org.mule.service.AbstractService |
connectListeners, disconnectListeners, dispatchEvent, dispose, doPause, doResume, fireServiceNotification, forceStop, getComponent, getExceptionListener, getInboundRouter, getIncomingEndpoints, getInitialState, getModel, getMuleContext, getName, getOutboundRouter, getReplyToHandler, getResponseRouter, getStatistics, handleException, initialise, invokeComponent, isPaused, isStarted, isStopped, isStopping, pause, processAsyncReplyRouter, processReplyTo, registerListeners, resume, sendEvent, sendToOutboundRouter, setComponent, setExceptionListener, setInboundRouter, setInitialState, setModel, setMuleContext, setName, setOutboundRouter, setResponseRouter, start, start, startListeners, stop, stopListeners, toString, unregisterListeners, waitIfPaused |
workManager
protected WorkManager workManager
queueTimeout
protected Integer queueTimeout
- The time out used for taking from the Seda Queue.
threadingProfile
protected ThreadingProfile threadingProfile
- The threading profile to use for this service. If this is not set a default
will be provided by the server
queueProfile
protected QueueProfile queueProfile
- The queue profile to use for this service. If this is not set a default
will be provided by the server
queue
protected Queue queue
SedaService
public SedaService()
- For Spring only
doInitialise
protected void doInitialise()
throws InitialisationException
- Initialise the service. The service will first create a Mule component from the
Service and then initialise a pool based on the attributes in the
Service.
- Overrides:
doInitialise
in class AbstractService
- Throws:
InitialisationException
- if the service fails
to initialise
doForceStop
protected void doForceStop()
throws MuleException
- Overrides:
doForceStop
in class AbstractService
- Throws:
MuleException
doStop
protected void doStop()
throws MuleException
- Overrides:
doStop
in class AbstractService
- Throws:
MuleException
doStart
protected void doStart()
throws MuleException
- Overrides:
doStart
in class AbstractService
- Throws:
MuleException
doDispose
protected void doDispose()
- Overrides:
doDispose
in class AbstractService
doDispatch
protected void doDispatch(MuleEvent event)
throws MuleException
- Specified by:
doDispatch
in class AbstractService
- Throws:
MuleException
doSend
protected MuleMessage doSend(MuleEvent event)
throws MuleException
- Specified by:
doSend
in class AbstractService
- Throws:
MuleException
getQueueSize
public int getQueueSize()
run
public void run()
- While the service isn't stopped this runs a continuous loop checking for new
events in the queue.
- Specified by:
run
in interface Runnable
release
public void release()
- Specified by:
release
in interface javax.resource.spi.work.Work
enqueue
protected void enqueue(MuleEvent event)
throws Exception
- Throws:
Exception
dequeue
protected MuleEvent dequeue()
throws Exception
- Throws:
Exception
workAccepted
public void workAccepted(javax.resource.spi.work.WorkEvent event)
- Specified by:
workAccepted
in interface javax.resource.spi.work.WorkListener
workRejected
public void workRejected(javax.resource.spi.work.WorkEvent event)
- Specified by:
workRejected
in interface javax.resource.spi.work.WorkListener
workStarted
public void workStarted(javax.resource.spi.work.WorkEvent event)
- Specified by:
workStarted
in interface javax.resource.spi.work.WorkListener
workCompleted
public void workCompleted(javax.resource.spi.work.WorkEvent event)
- Specified by:
workCompleted
in interface javax.resource.spi.work.WorkListener
handleWorkException
protected void handleWorkException(javax.resource.spi.work.WorkEvent event,
String type)
createStatistics
protected ServiceStatistics createStatistics()
- Overrides:
createStatistics
in class AbstractService
getInstance
public Object getInstance()
throws MuleException
- Throws:
MuleException
getQueueProfile
public QueueProfile getQueueProfile()
setQueueProfile
public void setQueueProfile(QueueProfile queueProfile)
getQueueTimeout
public Integer getQueueTimeout()
setQueueTimeout
public void setQueueTimeout(Integer queueTimeout)
getThreadingProfile
public ThreadingProfile getThreadingProfile()
setThreadingProfile
public void setThreadingProfile(ThreadingProfile threadingProfile)
getWorkManager
public WorkManager getWorkManager()
setWorkManager
public void setWorkManager(WorkManager workManager)
dispatchToOutboundRouter
protected void dispatchToOutboundRouter(MuleEvent event,
MuleMessage result)
throws MessagingException
- Overrides:
dispatchToOutboundRouter
in class AbstractService
- Throws:
MessagingException
Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.