org.mule.providers
Class AbstractMessageReceiver

java.lang.Object
  extended byorg.mule.providers.AbstractMessageReceiver
All Implemented Interfaces:
Disposable, UMOMessageReceiver
Direct Known Subclasses:
AxisMessageReceiver, GlueMessageReceiver, PollingMessageReceiver, ServletMessageReceiver, TcpMessageReceiver, UdpMessageReceiver, VMMessageReceiver, XmppMessageReceiver

public abstract class AbstractMessageReceiver
extends java.lang.Object
implements UMOMessageReceiver

AbstractMessageReceiver provides common methods for all Message Receivers provided with Mule. A message receiver enables an endpoint to receive a message from an external system.

Version:
$Revision: 1.17 $
Author:
Ross Mason

Field Summary
protected  UMOComponent component
          The Component with which this receiver is associated with
protected  UMOConnector connector
          the endpoint to receive events on
protected  SynchronizedBoolean disposing
           
protected  UMOEndpoint endpoint
          The endpoint descriptor which is associated with this receiver
protected  Log logger
          logger used by this class
protected  UMOModel model
          The model managing the UMO components
protected  boolean serverSide
           
 
Constructor Summary
AbstractMessageReceiver()
           
 
Method Summary
protected  boolean allowFilter(UMOFilter filter)
           
 void create(UMOConnector connector, UMOComponent component, UMOEndpoint endpoint)
          Creates the Message Receiver
 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.
protected  void doDispose()
          Template method to dispose any resources associated with this receiver.
 UMOComponent getComponent()
           
 UMOConnector getConnector()
           
 UMOEndpoint getEndpoint()
           
 UMOEndpointURI getEndpointURI()
          The endpointUri that this receiver listens on
protected  UMOWorkManager getWorkManager()
           
 void handleException(java.lang.Exception exception)
           
protected  UMOMessage handleUnacceptedFilter(UMOMessage message)
           
 boolean isServerSide()
           
 UMOMessage routeMessage(UMOMessage message)
           
 UMOMessage routeMessage(UMOMessage message, boolean synchronous)
           
 UMOMessage routeMessage(UMOMessage message, boolean synchronous, java.io.OutputStream outputStream)
           
 UMOMessage routeMessage(UMOMessage message, java.io.OutputStream outputStream)
           
 UMOMessage routeMessage(UMOMessage message, UMOTransaction trans, boolean synchronous)
           
 UMOMessage routeMessage(UMOMessage message, UMOTransaction trans, boolean synchronous, java.io.OutputStream outputStream)
           
 void setComponent(UMOComponent component)
           
 void setConnector(UMOConnector connector)
           
 void setEndpoint(UMOEndpoint endpoint)
           
 void setServerSide(boolean serverSide)
           
protected  void setWorkManager(UMOWorkManager workManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected transient Log logger
logger used by this class


component

protected UMOComponent component
The Component with which this receiver is associated with


endpoint

protected UMOEndpoint endpoint
The endpoint descriptor which is associated with this receiver


model

protected UMOModel model
The model managing the UMO components


connector

protected UMOConnector connector
the endpoint to receive events on


serverSide

protected boolean serverSide

disposing

protected SynchronizedBoolean disposing
Constructor Detail

AbstractMessageReceiver

public AbstractMessageReceiver()
Method Detail

create

public void create(UMOConnector connector,
                   UMOComponent component,
                   UMOEndpoint endpoint)
            throws InitialisationException
Description copied from interface: UMOMessageReceiver
Creates the Message Receiver

Specified by:
create in interface UMOMessageReceiver
Parameters:
connector - the endpoint that created this listener
component - the component to associate with the receiver. When data is recieved the component dispatchEvent or sendEvent is used to dispatch the data to the relivant UMO.
endpoint - the proivder contains the endpointUri on which the receiver will listen on. The endpointUri can be anything and is specific to the receiver implementation i.e. an email address, a directory, a jms destination or port address.
Throws:
InitialisationException
See Also:
UMOComponent, UMOEndpoint

getEndpoint

public UMOEndpoint getEndpoint()
Specified by:
getEndpoint in interface UMOMessageReceiver
Returns:
the receivers endpoint

handleException

public void handleException(java.lang.Exception exception)

getConnector

public UMOConnector getConnector()
Specified by:
getConnector in interface UMOMessageReceiver

setConnector

public void setConnector(UMOConnector connector)
Specified by:
setConnector in interface UMOMessageReceiver

getComponent

public UMOComponent getComponent()
Specified by:
getComponent in interface UMOMessageReceiver
Returns:
the component associated with the receiver

routeMessage

public final UMOMessage routeMessage(UMOMessage message)
                              throws UMOException
Throws:
UMOException

routeMessage

public final UMOMessage routeMessage(UMOMessage message,
                                     boolean synchronous)
                              throws UMOException
Throws:
UMOException

routeMessage

public final UMOMessage routeMessage(UMOMessage message,
                                     UMOTransaction trans,
                                     boolean synchronous)
                              throws UMOException
Throws:
UMOException

routeMessage

public final UMOMessage routeMessage(UMOMessage message,
                                     java.io.OutputStream outputStream)
                              throws UMOException
Throws:
UMOException

routeMessage

public final UMOMessage routeMessage(UMOMessage message,
                                     boolean synchronous,
                                     java.io.OutputStream outputStream)
                              throws UMOException
Throws:
UMOException

routeMessage

public final UMOMessage routeMessage(UMOMessage message,
                                     UMOTransaction trans,
                                     boolean synchronous,
                                     java.io.OutputStream outputStream)
                              throws UMOException
Throws:
UMOException

handleUnacceptedFilter

protected UMOMessage handleUnacceptedFilter(UMOMessage message)

setEndpoint

public void setEndpoint(UMOEndpoint endpoint)
Specified by:
setEndpoint in interface UMOMessageReceiver
Parameters:
endpoint - the endpoint to listen on
See Also:
UMOEndpoint

setComponent

public void setComponent(UMOComponent component)
Specified by:
setComponent in interface UMOMessageReceiver
Parameters:
component - the component to associate with the receiver. When data is recieved the component dispatchEvent or sendEvent is used to dispatch the data to the relivant UMO.

dispose

public final 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

doDispose

protected void doDispose()
Template method to dispose any resources associated with this receiver. There is not need to dispose the connector as this is already done by the framework


getEndpointURI

public UMOEndpointURI getEndpointURI()
Description copied from interface: UMOMessageReceiver
The endpointUri that this receiver listens on

Specified by:
getEndpointURI in interface UMOMessageReceiver
Returns:

allowFilter

protected boolean allowFilter(UMOFilter filter)
                       throws java.lang.UnsupportedOperationException
Throws:
java.lang.UnsupportedOperationException

isServerSide

public boolean isServerSide()

setServerSide

public void setServerSide(boolean serverSide)

getWorkManager

protected UMOWorkManager getWorkManager()

setWorkManager

protected void setWorkManager(UMOWorkManager workManager)


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