org.mule.ra
Class JcaComponent

java.lang.Object
  extended by org.mule.impl.model.AbstractComponent
      extended by org.mule.ra.JcaComponent
All Implemented Interfaces:
Serializable, EventListener, javax.resource.spi.work.WorkListener, Disposable, Initialisable, Lifecycle, Startable, Stoppable, UMOComponent

public class JcaComponent
extends AbstractComponent
implements javax.resource.spi.work.WorkListener

JcaComponent Is the type of component used in Mule when embedded inside an app server using JCA. In the future we might want to use one of the existing models.

See Also:
Serialized Form

Nested Class Summary
 class JcaComponent.MuleJcaWorker
           
 
Field Summary
protected  UMOWorkManager workManager
           
 
Fields inherited from class org.mule.impl.model.AbstractComponent
descriptor, exceptionListener, initialised, logger, model, paused, poolInitialised, stats, stopped, stopping
 
Constructor Summary
JcaComponent(MuleDescriptor descriptor, UMOWorkManager workManager)
           
 
Method Summary
protected  void doDispatch(UMOEvent event)
           
 void doInitialise()
           
protected  void doPause()
          Custom components can execute code necessary to put the component in a paused state here.
protected  void doResume()
          Custom components can execute code necessary to resume a component once it has been paused If a developer overloads this method the doPause() method MUST also be overloaded to avoid inconsistent state in the component
protected  UMOMessage doSend(UMOEvent event)
          Implementation of template method which is never call because send() is overwritten
 UMODescriptor getDescriptor()
           
 Object getManagedInstance()
           
 boolean isPaused()
          Determines if the component is in a paused state
 UMOMessage sendEvent(UMOEvent event)
          This is the synchronous call method and not supported by components managed in a JCA container
protected  void waitIfPaused(UMOEvent event)
          Called before an event is sent or dispatched to a component, it will block until resume() is called.
 void workAccepted(javax.resource.spi.work.WorkEvent arg0)
           
 void workCompleted(javax.resource.spi.work.WorkEvent arg0)
           
 void workRejected(javax.resource.spi.work.WorkEvent arg0)
           
 void workStarted(javax.resource.spi.work.WorkEvent arg0)
           
 
Methods inherited from class org.mule.impl.model.AbstractComponent
connectListeners, createStatistics, disconnectListeners, dispatchEvent, dispose, doDispose, doForceStop, doStart, doStop, fireComponentNotification, forceStop, getIncomingEndpoints, getInstance, getName, getStatistics, handleException, initialise, isStarted, isStopped, isStopping, lookupComponent, pause, registerListeners, resume, start, start, startListeners, stop, stopListeners, toString, unregisterListeners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

workManager

protected UMOWorkManager workManager
Constructor Detail

JcaComponent

public JcaComponent(MuleDescriptor descriptor,
                    UMOWorkManager workManager)
Method Detail

getDescriptor

public UMODescriptor getDescriptor()
Specified by:
getDescriptor in interface UMOComponent
Overrides:
getDescriptor in class AbstractComponent
Returns:
the UMODescriptor associated with the component
See Also:
UMODescriptor

sendEvent

public UMOMessage sendEvent(UMOEvent event)
                     throws UMOException
This is the synchronous call method and not supported by components managed in a JCA container

Specified by:
sendEvent in interface UMOComponent
Overrides:
sendEvent in class AbstractComponent
Parameters:
event -
Returns:
Throws:
UMOException

isPaused

public boolean isPaused()
Description copied from class: AbstractComponent
Determines if the component is in a paused state

Specified by:
isPaused in interface UMOComponent
Overrides:
isPaused in class AbstractComponent
Returns:
True if the component is in a paused state, false otherwise

waitIfPaused

protected void waitIfPaused(UMOEvent event)
                     throws InterruptedException
Description copied from class: AbstractComponent
Called before an event is sent or dispatched to a component, it will block until resume() is called. Users can override this method if they want to handle pausing differently e.g. implement a store and forward policy

Overrides:
waitIfPaused in class AbstractComponent
Parameters:
event - the current event being passed to the component
Throws:
InterruptedException - if the thread is interrupted

doPause

protected void doPause()
                throws UMOException
Description copied from class: AbstractComponent
Custom components can execute code necessary to put the component in a paused state here. If a developer overloads this method the doResume() method MUST also be overloaded to avoid inconsistent state in the component

Overrides:
doPause in class AbstractComponent
Throws:
UMOException

doResume

protected void doResume()
                 throws UMOException
Description copied from class: AbstractComponent
Custom components can execute code necessary to resume a component once it has been paused If a developer overloads this method the doPause() method MUST also be overloaded to avoid inconsistent state in the component

Overrides:
doResume in class AbstractComponent
Throws:
UMOException

doInitialise

public void doInitialise()
                  throws InitialisationException
Overrides:
doInitialise in class AbstractComponent
Throws:
InitialisationException

doDispatch

protected void doDispatch(UMOEvent event)
                   throws UMOException
Specified by:
doDispatch in class AbstractComponent
Throws:
UMOException

doSend

protected UMOMessage doSend(UMOEvent event)
                     throws UMOException
Implementation of template method which is never call because send() is overwritten

Specified by:
doSend in class AbstractComponent
Throws:
UMOException

getManagedInstance

public Object getManagedInstance()
                          throws UMOException
Throws:
UMOException

workAccepted

public void workAccepted(javax.resource.spi.work.WorkEvent arg0)
Specified by:
workAccepted in interface javax.resource.spi.work.WorkListener

workCompleted

public void workCompleted(javax.resource.spi.work.WorkEvent arg0)
Specified by:
workCompleted in interface javax.resource.spi.work.WorkListener

workRejected

public void workRejected(javax.resource.spi.work.WorkEvent arg0)
Specified by:
workRejected in interface javax.resource.spi.work.WorkListener

workStarted

public void workStarted(javax.resource.spi.work.WorkEvent arg0)
Specified by:
workStarted in interface javax.resource.spi.work.WorkListener


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.