|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mule.impl.model.AbstractComponent
org.mule.impl.model.seda.SedaComponent
public class SedaComponent
A Seda component runs inside a Seda Model and is responsible for managing a Seda Queue and thread pool for a Mule sevice component. In Seda terms this is equivilent to a stage.
Field Summary | |
---|---|
protected boolean |
componentPerRequest
If this is set to true a new component will be created for every request. |
protected MuleProxy |
componentProxy
Is created only if component pooling is turned off on the SEDAModel. |
protected String |
descriptorQueueName
|
protected boolean |
enablePooling
Whether component objects should be pooled or a single instance should be used. |
static String |
POOLING_PROFILE_PROPERTY
|
protected PoolingProfile |
poolingProfile
The pooling configuration used when initialising the component described by this descriptor. |
protected ObjectPool |
proxyPool
A pool of available Mule proxies. |
static String |
QUEUE_PROFILE_PROPERTY
|
protected QueueProfile |
queueProfile
The queuing profile for events received for this component. |
protected int |
queueTimeout
The time out used for taking from the Seda Queue. |
protected UMOWorkManager |
workManager
|
Fields inherited from class org.mule.impl.model.AbstractComponent |
---|
descriptor, exceptionListener, initialised, logger, model, paused, poolInitialised, stats, stopped, stopping |
Constructor Summary | |
---|---|
SedaComponent(MuleDescriptor descriptor,
SedaModel model)
Creates a new SEDA component. |
Method Summary | |
---|---|
protected MuleProxy |
createComponentProxy()
|
protected ObjectPool |
createPool()
|
protected ComponentStatistics |
createStatistics()
|
protected UMOEvent |
dequeue()
|
protected void |
doDispatch(UMOEvent event)
|
protected void |
doDispose()
|
void |
doForceStop()
|
void |
doInitialise()
Initialise the component. |
protected void |
doReleaseProxy(MuleProxy proxy)
This method is called once when a proxy has finished processing a request (regardless of success). |
UMOMessage |
doSend(UMOEvent event)
|
void |
doStart()
|
void |
doStop()
|
protected void |
enqueue(UMOEvent event)
|
PoolingProfile |
getPoolingProfile()
|
protected MuleProxy |
getProxy()
The proxy may be one of three types: 1. |
QueueProfile |
getQueueProfile()
|
int |
getQueueSize()
|
protected void |
handleWorkException(javax.resource.spi.work.WorkEvent event,
String type)
|
protected void |
initialisePool()
|
void |
release()
|
void |
run()
While the component isn't stopped this runs a continuous loop checking for new events in the queue. |
void |
setPoolingProfile(PoolingProfile poolingProfile)
|
void |
setQueueProfile(QueueProfile queueProfile)
|
void |
workAccepted(javax.resource.spi.work.WorkEvent event)
|
void |
workCompleted(javax.resource.spi.work.WorkEvent event)
There are two units of work that call this method when they complete (regardless of whether or not they incurred an exception): 1) This component's queue listener that processes asynchronous events by scheduling a component proxy 2) Each scheduled component proxy |
void |
workRejected(javax.resource.spi.work.WorkEvent event)
This method ensures that any component proxy associated with this rejected work is released. |
void |
workStarted(javax.resource.spi.work.WorkEvent event)
|
Methods inherited from class org.mule.impl.model.AbstractComponent |
---|
connectListeners, disconnectListeners, dispatchEvent, dispose, doPause, doResume, fireComponentNotification, forceStop, getDescriptor, getIncomingEndpoints, getInstance, getName, getStatistics, handleException, initialise, isPaused, isStarted, isStopped, isStopping, lookupComponent, pause, registerListeners, resume, sendEvent, start, start, startListeners, stop, stopListeners, toString, unregisterListeners, waitIfPaused |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String QUEUE_PROFILE_PROPERTY
public static final String POOLING_PROFILE_PROPERTY
protected ObjectPool proxyPool
protected MuleProxy componentProxy
componentPerRequest
flag is set on the model.
protected UMOWorkManager workManager
protected String descriptorQueueName
protected int queueTimeout
protected boolean enablePooling
protected boolean componentPerRequest
protected PoolingProfile poolingProfile
protected QueueProfile queueProfile
Constructor Detail |
---|
public SedaComponent(MuleDescriptor descriptor, SedaModel model)
descriptor
- The descriptor of the component to creatmodel
- the model in which the component is registeredMethod Detail |
---|
public void doInitialise() throws InitialisationException
doInitialise
in class AbstractComponent
InitialisationException
- if the component fails
to initialiseUMODescriptor
protected ComponentStatistics createStatistics()
createStatistics
in class AbstractComponent
protected ObjectPool createPool() throws InitialisationException
InitialisationException
protected void initialisePool() throws InitialisationException
InitialisationException
protected MuleProxy createComponentProxy() throws InitialisationException
InitialisationException
public void doForceStop() throws UMOException
doForceStop
in class AbstractComponent
UMOException
public void doStop() throws UMOException
doStop
in class AbstractComponent
UMOException
public void doStart() throws UMOException
doStart
in class AbstractComponent
UMOException
protected void doDispose()
doDispose
in class AbstractComponent
protected void doDispatch(UMOEvent event) throws UMOException
doDispatch
in class AbstractComponent
UMOException
public UMOMessage doSend(UMOEvent event) throws UMOException
doSend
in class AbstractComponent
UMOException
public int getQueueSize()
public void run()
run
in interface Runnable
protected MuleProxy getProxy() throws Exception
Exception
public void release()
release
in interface javax.resource.spi.work.Work
protected void enqueue(UMOEvent event) throws Exception
Exception
protected UMOEvent dequeue() throws Exception
Exception
public void workAccepted(javax.resource.spi.work.WorkEvent event)
workAccepted
in interface javax.resource.spi.work.WorkListener
public void workRejected(javax.resource.spi.work.WorkEvent event)
workRejected
in interface javax.resource.spi.work.WorkListener
workCompleted(WorkEvent)
public void workStarted(javax.resource.spi.work.WorkEvent event)
workStarted
in interface javax.resource.spi.work.WorkListener
public void workCompleted(javax.resource.spi.work.WorkEvent event)
Generally, #1 occurs each time the component stops and #2 occurs at the end of each asynchronous event.
This method is responsible for handling any exceptions that occur for both #1 and #2 and releasing the proxy from #2.
workCompleted
in interface javax.resource.spi.work.WorkListener
WorkListener.workCompleted(WorkEvent)
protected void handleWorkException(javax.resource.spi.work.WorkEvent event, String type)
public PoolingProfile getPoolingProfile()
public void setPoolingProfile(PoolingProfile poolingProfile)
public QueueProfile getQueueProfile()
public void setQueueProfile(QueueProfile queueProfile)
protected void doReleaseProxy(MuleProxy proxy) throws Exception
NOTE: The implementation of this method must be thread-safe.
proxy
- -
the proxy that has completed; must be non-null.
Exception
- -
the proxy cannot be released.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |