org.mule.impl
Class MuleProxy

java.lang.Object
  extended byorg.mule.impl.MuleProxy
All Implemented Interfaces:
Disposable, Lifecycle, java.lang.Runnable, Startable, Stoppable

public class MuleProxy
extends java.lang.Object
implements java.lang.Runnable, Lifecycle

MuleProxy is a proxy to a UMO. It is a poolable object that that can be executed in it's own thread.

Version:
$Revision: 1.2 $
Author:
Ross Mason

Constructor Summary
MuleProxy(java.lang.Object component, MuleDescriptor descriptor, ObjectPool proxyPool)
          Constructs a Proxy using the UMO's AbstractMessageDispatcher and the UMO itself
 
Method Summary
 void dispose()
           
 UMOImmutableDescriptor getDescriptor()
           
 ComponentStatistics getStatistics()
           
 void handleException(java.lang.Object source, java.lang.Throwable exception)
          When an exception occurs this method can be called to invoke the configured UMOExceptionStrategy on the UMO
 boolean isStarted()
           
 boolean isSuspended()
          Determines if the proxy is suspended
 java.lang.Object onCall(UMOEvent event)
          Makes a synchronous call on the UMO
 void onEvent(UMOEvent event)
          Sets the current event being processed
 void resume()
          Triggers the UMO to resume processing of events if it is suspended
 void run()
           
 void setStatistics(ComponentStatistics stat)
           
 void start()
           
 void stop()
           
 void suspend()
          Controls the suspension of the UMO event processing
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MuleProxy

public MuleProxy(java.lang.Object component,
                 MuleDescriptor descriptor,
                 ObjectPool proxyPool)
          throws UMOException
Constructs a Proxy using the UMO's AbstractMessageDispatcher and the UMO itself

Parameters:
component - the underlying object that with receive events
descriptor - the UMOComponent descriptor associated with the component
Method Detail

start

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

isStarted

public boolean isStarted()

stop

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

dispose

public void dispose()
             throws UMOException
Specified by:
dispose in interface Disposable
Throws:
UMOException

onEvent

public void onEvent(UMOEvent event)
Sets the current event being processed

Parameters:
event - the event being processed

getStatistics

public ComponentStatistics getStatistics()

setStatistics

public void setStatistics(ComponentStatistics stat)

onCall

public java.lang.Object onCall(UMOEvent event)
                        throws UMOException
Makes a synchronous call on the UMO

Parameters:
event - the event to pass to the UMO
Returns:
the return event from the UMO
Throws:
UMOException - if the call fails

handleException

public void handleException(java.lang.Object source,
                            java.lang.Throwable exception)
When an exception occurs this method can be called to invoke the configured UMOExceptionStrategy on the UMO

Parameters:
source - Usually is the current payload but can be anything
exception - If the UMOExceptionStrategy implementation fails

toString

public java.lang.String toString()

isSuspended

public boolean isSuspended()
Determines if the proxy is suspended

Returns:
true if the proxy (and the UMO) are suspended

suspend

public void suspend()
Controls the suspension of the UMO event processing


resume

public void resume()
Triggers the UMO to resume processing of events if it is suspended


run

public void run()
Specified by:
run in interface java.lang.Runnable

getDescriptor

public UMOImmutableDescriptor getDescriptor()


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