org.mule.impl
Class MuleProxy

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

public class MuleProxy
extends java.lang.Object
implements 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.9 $
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()
          A lifecycle method where implementor should fee up any resources If an exception is thrown it should just be logged and processing should continue.
 UMOImmutableDescriptor getDescriptor()
           
 ComponentStatistics getStatistics()
           
 void handleException(java.lang.Exception 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
protected  UMOMessage processResponse(UMOMessage message, java.lang.Object replyTo, ReplyToHandler replyToHandler)
           
 void release()
           
 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()
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

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

processResponse

protected UMOMessage processResponse(UMOMessage message,
                                     java.lang.Object replyTo,
                                     ReplyToHandler replyToHandler)
                              throws UMOException
Throws:
UMOException

handleException

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

Parameters:
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()

release

public void release()

getDescriptor

public UMOImmutableDescriptor getDescriptor()


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