org.mule.impl
Class MuleComponent

java.lang.Object
  extended byorg.mule.impl.MuleComponent
All Implemented Interfaces:
Disposable, Initialisable, Lifecycle, java.io.Serializable, Startable, Stoppable, UMOComponent

public final class MuleComponent
extends java.lang.Object
implements UMOComponent

MuleComponent manages the interaction and distribution of events for a Mule-managed component.

Version:
$Revision: 1.7 $
Author:
Ross Mason
See Also:
Serialized Form

Constructor Summary
MuleComponent(MuleDescriptor descriptor)
          Default constructor
 
Method Summary
 void dispatchEvent(UMOEvent event)
          Makes an asynhronous event call to the component.
 void dispose()
          A lifecycle method where implementor should fee up any resources If an exception is thrown it should just be logged and processing should continue.
 UMODescriptor getDescriptor()
           
 java.lang.String getName()
           
 int getQueueSize()
           
 ComponentStatistics getStatistics()
           
protected  void handleException(java.lang.Exception e)
           
 void initialise()
          Initialise the component.
 boolean isPaused()
           
 boolean isStopped()
           
 void pause()
          Pauses event processing for theComponent.
 void release()
           
 void resume()
          Resumes the Component that has been paused.
 void run()
          While the component isn't stopped this runs a continuous loop checking for new events in the queue
 UMOMessage sendEvent(UMOEvent event)
          Makes a synhronous event call to the component.
 void start()
           
 void stop()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MuleComponent

public MuleComponent(MuleDescriptor descriptor)
Default constructor

Method Detail

initialise

public void initialise()
                throws InitialisationException
Initialise the component. The component will first create a Mule UMO from the UMODescriptor and then initialise a pool based on the attributes in the UMODescriptor.

Specified by:
initialise in interface Initialisable
Throws:
InitialisationException - if the component fails to initialise
See Also:
UMODescriptor

stop

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

start

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

pause

public void pause()
Description copied from interface: UMOComponent
Pauses event processing for theComponent. Unlike stop(), a paused component will still consume messages from the underlying transport, but those messages will be queued until the component is resumed. In order to persist these queued messages you can set the 'recoverableMode' property on the Muleconfiguration to true. this causes all internal queues to store their state.

Specified by:
pause in interface UMOComponent
See Also:
MuleConfiguration

resume

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

Specified by:
resume in interface UMOComponent

dispose

public void dispose()
Description copied from interface: Disposable
A lifecycle method where implementor should fee 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

getStatistics

public ComponentStatistics getStatistics()

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
Description copied from interface: UMOComponent
Makes a synhronous event call to the component. This event will be consumed by the component and a result returned.

Specified by:
sendEvent in interface UMOComponent
Parameters:
event - the event to consume
Returns:
a UMOMessage containing the resulting message and properties
Throws:
UMOException - if the event fails to be processed

getName

public java.lang.String getName()
Returns:
the Mule descriptor name which is associated with the component

toString

public java.lang.String toString()

getQueueSize

public int getQueueSize()

isStopped

public boolean isStopped()

isPaused

public boolean isPaused()

run

public void run()
While the component isn't stopped this runs a continuous loop checking for new events in the queue


release

public void release()

handleException

protected void handleException(java.lang.Exception e)


Copyright © 2003-2005 SymphonySoft Limited. All Rights Reserved.