Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mule.umo.impl
Class MuleUMO  view MuleUMO download MuleUMO.java

java.lang.Object
  extended byorg.mule.umo.impl.SimpleMuleChain
      extended byorg.mule.umo.impl.MuleUMO
All Implemented Interfaces:
org.mule.umo.UMOChain, org.mule.umo.UMOEventListener, org.mule.umo.UniversalMessageObject

public abstract class MuleUMO
extends SimpleMuleChain
implements org.mule.umo.UniversalMessageObject

MuleUMO is a basis for all Mule UMOs. It provides and simplifies the logic necessary to send and receive Messages via Mule providers

Version:
$Revision: 1.10 $

Field Summary
private  org.mule.umo.UMOEvent currentEvent
          the current event being processed by this component
protected  org.mule.umo.UMODescriptor descriptor
          The configuration descriptor for the component
private  boolean isStarted
          Determines whether the Mule is started
protected  org.apache.commons.logging.Log log
          Logger for this class
protected  org.mule.MuleManager manager
          The Singleton Mule Manager
 
Fields inherited from class org.mule.umo.impl.SimpleMuleChain
 
Constructor Summary
MuleUMO()
           
 
Method Summary
 org.mule.umo.UMOEvent createOutboundEvent(java.lang.Object data)
          Will create a UMOEvent based on the current settings of the UMODescriptor and the data passed
 org.mule.umo.UMOEvent createOutboundEvent(java.lang.Object data, java.util.HashMap props)
          A helper method for creating an outbound UMOEvent.
 org.mule.umo.UMOEvent createOutboundEvent(java.lang.Object data, org.mule.umo.UMOProviderDescriptor provider)
          A helper method for creating an outbound UMOEvent.
 org.mule.umo.UMOEvent createOutboundEvent(java.lang.Object data, org.mule.umo.UMOProviderDescriptor provider, java.util.HashMap props)
          Will create a UMOEvent based on the current settings of the UMODescriptor and the data passed
 void destroy()
          A stub method where the user can execute any code to destroy connections and resources
 void dispatchEvent(java.lang.Object message, java.util.HashMap props)
          A helper method for dispatching a UMOEvent asynchronously.
 void dispatchEvent(java.lang.Object message, org.mule.umo.UMOProviderDescriptor provider, java.util.HashMap props)
          Dispatches an event asynchronously over a configured provider
 void dispatchEvent(org.mule.umo.UMOEvent event)
          Dispatches an event asynchronously over a configured provider
(package private)  org.mule.umo.UMOEvent getCurrentEvent()
           
 org.mule.umo.UMODescriptor getDescriptor()
           
protected  org.mule.umo.UMOProviderDescriptor getInboundProvider()
           
 org.mule.MuleManager getManager()
           
 java.lang.String getName()
           
protected  org.mule.umo.UMOProviderDescriptor getOutboundProvider()
           
 org.mule.umo.UMOSession getSession()
           
 void handleException(java.lang.Object message, java.lang.Throwable t)
          When an exception occurs this method can be called to invoke the the configured UMOExceptionStrategy on this component
 void init(org.mule.umo.UMODescriptor descriptor, org.mule.MuleManager manager)
           
 boolean isStarted()
           
 boolean isStopped()
           
 org.mule.umo.UMOEvent receiveEvent(long timeout)
          A helper method to make a synchronous request for an event.
 org.mule.umo.UMOEvent receiveEvent(org.mule.umo.UMOProviderDescriptor provider, long timeout)
          Requests a synchronous receive of an event on the session
 org.mule.umo.UMOEvent receiveEvent(org.mule.umo.UMOProviderDescriptor provider, long timeout, org.mule.umo.UMOEvent currentEvent)
          A method to make a synchronous request for an event.
 void resume()
          Is called when the component should resume processing
 org.mule.umo.UMOEvent sendEvent(java.lang.Object data, java.util.HashMap props)
          A helper method for sending an event synchronously.
 java.lang.Object sendEvent(java.lang.Object message, org.mule.umo.UMOProviderDescriptor provider, java.util.HashMap props)
          Sends an event synchronously over a configured provider
 org.mule.umo.UMOEvent sendEvent(org.mule.umo.UMOEvent event)
          Sends an event synchronously over a configured provider
(package private)  void setCurrentEvent(org.mule.umo.UMOEvent event)
           
 void start()
          A stub method where the user can execute any initialisation code
 void startProcessing()
          Tells the Mule UMO it can start processing messages This method will call the stub method start() where the user can execute any initialisation code
 void stop()
          A stub method where the user can execute any code to stop connections and resources
 void stopProcessing()
          Tells the Mule UMO it should stop processing messages This method will call the stub method stop() where the user can execute any code to stop or destroy connections and resources
 void suspend()
          Is called when the component should suspend processing, i.e a umo in a pool might want to clear any local resuorces before being returned to the pool
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class org.mule.umo.impl.SimpleMuleChain
breakChain, doChain, doSyncChain, getFirst, getLast, getNext, getOwner, getPrevious, isBreakChain, isSendbound, setName, setNext, setOwner, setPrevious, startChain, startSyncChain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mule.umo.UMOChain
breakChain, doChain, doSyncChain, getFirst, getLast, getNext, getOwner, getPrevious, initialise, isBreakChain, setName, setNext, setOwner, setPrevious, startChain, startSyncChain
 
Methods inherited from interface org.mule.umo.UMOEventListener
onEvent
 

Field Detail

descriptor

protected org.mule.umo.UMODescriptor descriptor
The configuration descriptor for the component


isStarted

private boolean isStarted
Determines whether the Mule is started


log

protected transient org.apache.commons.logging.Log log
Logger for this class


manager

protected transient org.mule.MuleManager manager
The Singleton Mule Manager


currentEvent

private org.mule.umo.UMOEvent currentEvent
the current event being processed by this component

Constructor Detail

MuleUMO

public MuleUMO()
Method Detail

getSession

public org.mule.umo.UMOSession getSession()
                                   throws org.mule.umo.UMOException
Specified by:
getSession in interface org.mule.umo.UniversalMessageObject

receiveEvent

public org.mule.umo.UMOEvent receiveEvent(long timeout)
                                   throws java.lang.Exception
A helper method to make a synchronous request for an event. The method assumes that the default send provider will be used to request the event.


receiveEvent

public org.mule.umo.UMOEvent receiveEvent(org.mule.umo.UMOProviderDescriptor provider,
                                          long timeout,
                                          org.mule.umo.UMOEvent currentEvent)
                                   throws java.lang.Exception
A method to make a synchronous request for an event.


receiveEvent

public org.mule.umo.UMOEvent receiveEvent(org.mule.umo.UMOProviderDescriptor provider,
                                          long timeout)
                                   throws java.lang.Exception
Description copied from interface: org.mule.umo.UniversalMessageObject
Requests a synchronous receive of an event on the session

Specified by:
receiveEvent in interface org.mule.umo.UniversalMessageObject

dispatchEvent

public void dispatchEvent(org.mule.umo.UMOEvent event)
                   throws java.lang.Exception
Description copied from interface: org.mule.umo.UniversalMessageObject
Dispatches an event asynchronously over a configured provider

Specified by:
dispatchEvent in interface org.mule.umo.UniversalMessageObject

dispatchEvent

public void dispatchEvent(java.lang.Object message,
                          java.util.HashMap props)
                   throws java.lang.Exception
A helper method for dispatching a UMOEvent asynchronously. The method assumes that the default send provider will be used to send the event.


dispatchEvent

public void dispatchEvent(java.lang.Object message,
                          org.mule.umo.UMOProviderDescriptor provider,
                          java.util.HashMap props)
                   throws java.lang.Exception
Description copied from interface: org.mule.umo.UniversalMessageObject
Dispatches an event asynchronously over a configured provider

Specified by:
dispatchEvent in interface org.mule.umo.UniversalMessageObject

getInboundProvider

protected org.mule.umo.UMOProviderDescriptor getInboundProvider()
                                                         throws org.mule.MuleException

getDescriptor

public org.mule.umo.UMODescriptor getDescriptor()
Specified by:
getDescriptor in interface org.mule.umo.UniversalMessageObject

getManager

public org.mule.MuleManager getManager()
Specified by:
getManager in interface org.mule.umo.UniversalMessageObject

getName

public java.lang.String getName()
Specified by:
getName in interface org.mule.umo.UniversalMessageObject
Overrides:
getName in class SimpleMuleChain

getOutboundProvider

protected org.mule.umo.UMOProviderDescriptor getOutboundProvider()
                                                          throws org.mule.umo.UMOException

handleException

public void handleException(java.lang.Object message,
                            java.lang.Throwable t)
Description copied from interface: org.mule.umo.UniversalMessageObject
When an exception occurs this method can be called to invoke the the configured UMOExceptionStrategy on this component

Specified by:
handleException in interface org.mule.umo.UniversalMessageObject

init

public void init(org.mule.umo.UMODescriptor descriptor,
                 org.mule.MuleManager manager)
          throws org.mule.umo.UMOException
Specified by:
init in interface org.mule.umo.UniversalMessageObject

isStarted

public boolean isStarted()
Specified by:
isStarted in interface org.mule.umo.UniversalMessageObject

isStopped

public boolean isStopped()
Specified by:
isStopped in interface org.mule.umo.UniversalMessageObject

sendEvent

public org.mule.umo.UMOEvent sendEvent(org.mule.umo.UMOEvent event)
                                throws java.lang.Exception
Description copied from interface: org.mule.umo.UniversalMessageObject
Sends an event synchronously over a configured provider

Specified by:
sendEvent in interface org.mule.umo.UniversalMessageObject

sendEvent

public org.mule.umo.UMOEvent sendEvent(java.lang.Object data,
                                       java.util.HashMap props)
                                throws java.lang.Exception
A helper method for sending an event synchronously. The method assumes that the defualt send provider for the Mule UMO will be used to send the event.


sendEvent

public java.lang.Object sendEvent(java.lang.Object message,
                                  org.mule.umo.UMOProviderDescriptor provider,
                                  java.util.HashMap props)
                           throws java.lang.Exception
Description copied from interface: org.mule.umo.UniversalMessageObject
Sends an event synchronously over a configured provider

Specified by:
sendEvent in interface org.mule.umo.UniversalMessageObject

start

public void start()
           throws org.mule.umo.UMOException
Description copied from interface: org.mule.umo.UniversalMessageObject
A stub method where the user can execute any initialisation code

Specified by:
start in interface org.mule.umo.UniversalMessageObject

destroy

public void destroy()
             throws org.mule.umo.UMOException
Description copied from interface: org.mule.umo.UniversalMessageObject
A stub method where the user can execute any code to destroy connections and resources

Specified by:
destroy in interface org.mule.umo.UniversalMessageObject

startProcessing

public final void startProcessing()
                           throws org.mule.umo.UMOException
Tells the Mule UMO it can start processing messages This method will call the stub method start() where the user can execute any initialisation code


stop

public void stop()
          throws org.mule.umo.UMOException
Description copied from interface: org.mule.umo.UniversalMessageObject
A stub method where the user can execute any code to stop connections and resources

Specified by:
stop in interface org.mule.umo.UniversalMessageObject

stopProcessing

public final void stopProcessing()
                          throws org.mule.umo.UMOException
Tells the Mule UMO it should stop processing messages This method will call the stub method stop() where the user can execute any code to stop or destroy connections and resources


createOutboundEvent

public org.mule.umo.UMOEvent createOutboundEvent(java.lang.Object data)
                                          throws org.mule.umo.UMOException
Description copied from interface: org.mule.umo.UniversalMessageObject
Will create a UMOEvent based on the current settings of the UMODescriptor and the data passed

Specified by:
createOutboundEvent in interface org.mule.umo.UniversalMessageObject

createOutboundEvent

public org.mule.umo.UMOEvent createOutboundEvent(java.lang.Object data,
                                                 java.util.HashMap props)
                                          throws org.mule.umo.UMOException
A helper method for creating an outbound UMOEvent. This assumes the default send provider will be used to create the event


createOutboundEvent

public org.mule.umo.UMOEvent createOutboundEvent(java.lang.Object data,
                                                 org.mule.umo.UMOProviderDescriptor provider)
                                          throws org.mule.umo.UMOException
A helper method for creating an outbound UMOEvent. This method assumes there are no properties to be sent with the event.


createOutboundEvent

public org.mule.umo.UMOEvent createOutboundEvent(java.lang.Object data,
                                                 org.mule.umo.UMOProviderDescriptor provider,
                                                 java.util.HashMap props)
                                          throws org.mule.umo.UMOException
Description copied from interface: org.mule.umo.UniversalMessageObject
Will create a UMOEvent based on the current settings of the UMODescriptor and the data passed

Specified by:
createOutboundEvent in interface org.mule.umo.UniversalMessageObject

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


getCurrentEvent

org.mule.umo.UMOEvent getCurrentEvent()

setCurrentEvent

void setCurrentEvent(org.mule.umo.UMOEvent event)

resume

public void resume()
Description copied from interface: org.mule.umo.UniversalMessageObject
Is called when the component should resume processing

Specified by:
resume in interface org.mule.umo.UniversalMessageObject

suspend

public void suspend()
Description copied from interface: org.mule.umo.UniversalMessageObject
Is called when the component should suspend processing, i.e a umo in a pool might want to clear any local resuorces before being returned to the pool

Specified by:
suspend in interface org.mule.umo.UniversalMessageObject