org.mule.ra
Class JcaComponent

java.lang.Object
  extended byorg.mule.ra.JcaComponent
All Implemented Interfaces:
Disposable, Initialisable, Lifecycle, Serializable, Startable, Stoppable, UMOComponent

public class JcaComponent
extends Object
implements UMOComponent

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

Constructor Summary
JcaComponent(MuleDescriptor descriptor)
           
 
Method Summary
 void dispatchEvent(UMOEvent event)
          Makes an asynhronous event call to the component.
 void dispose()
          A lifecycle method where implementor should free up any resources.
protected  Object getDelegateComponent()
           
 UMODescriptor getDescriptor()
           
 Object getInstance()
          Gets the underlying instance form this component Where the Component implmentation provides pooling this is no 1-2-1 mapping between UMOComponent and instance, so this method will return the object in initial state.
 void initialise()
          Method used to perform any initialisation work.
 boolean isPaused()
          True if the component is in a paused state, false otherwise
 boolean isStarted()
          Determines whether this component has been started
 void pause()
          Pauses event processing for a single Mule Component.
 void resume()
          Resumes a single Mule Component that has been paused.
 UMOMessage sendEvent(UMOEvent event)
          This is the synchronous call method and not supported by components managed in a JCA container
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JcaComponent

public JcaComponent(MuleDescriptor descriptor)
Method Detail

getDescriptor

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

dispatchEvent

public void dispatchEvent(UMOEvent event)
                   throws UMOException
Description copied from interface: UMOComponent
Makes an asynhronous event call to the component.

Specified by:
dispatchEvent in interface UMOComponent
Parameters:
event - the event to consume
Throws:
UMOException - if the event fails to be processed

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
Parameters:
event -
Returns:
Throws:
UMOException

pause

public void pause()
           throws UMOException
Description copied from interface: UMOComponent
Pauses event processing for a single Mule Component. Unlike stop(), a paused component will still consume messages from the underlying transport, but those messages will be queued until the component is resumed.

Specified by:
pause in interface UMOComponent
Throws:
UMOException

resume

public void resume()
            throws UMOException
Description copied from interface: UMOComponent
Resumes a single Mule Component that has been paused. If the component is not paused nothing is executed.

Specified by:
resume in interface UMOComponent
Throws:
UMOException

isPaused

public boolean isPaused()
Description copied from interface: UMOComponent
True if the component is in a paused state, false otherwise

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

start

public void start()
           throws UMOException
Specified by:
start in interface Startable
Throws:
UMOException

stop

public void stop()
          throws UMOException
Specified by:
stop in interface Stoppable
Throws:
UMOException

dispose

public void dispose()
Description copied from interface: Disposable
A lifecycle method where implementor should free up any resources. If an exception is thrown it should just be logged and processing should continue. This method should not throw Runtime exceptions.

Specified by:
dispose in interface Disposable

initialise

public void initialise()
                throws InitialisationException
Description copied from interface: Initialisable
Method used to perform any initialisation work. If a fatal error occurs during initialisation an InitialisationException should be thrown, causing the Mule instance to shutdown. If the error is recoverable, say by retrying to connect, a RecoverableException should be thrown. There is no guarantee that by throwing a Recoverable exception that the Mule instance will not shut down.

Specified by:
initialise in interface Initialisable
Throws:
InitialisationException - if a fatal error occurs causing the Mule instance to shutdown

getDelegateComponent

protected Object getDelegateComponent()
                               throws InitialisationException
Throws:
InitialisationException

isStarted

public boolean isStarted()
Description copied from interface: UMOComponent
Determines whether this component has been started

Specified by:
isStarted in interface UMOComponent
Returns:
true is the component is started andready to receive events

getInstance

public Object getInstance()
                   throws UMOException
Gets the underlying instance form this component Where the Component implmentation provides pooling this is no 1-2-1 mapping between UMOComponent and instance, so this method will return the object in initial state.

If the underlying component is Container managed in Spring or another IoC container then the object instance in the IoC container will be returned

Specified by:
getInstance in interface UMOComponent
Returns:
the underlying instance form this component
Throws:
UMOException


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