org.mule.umo.provider
Interface UMOMessageDispatcherFactory

All Known Implementing Classes:
AbstractMessageDispatcherFactory, AxisMessageDispatcherFactory, AxisWsdlMessageDispatcherFactory, EjbMessageDispatcherFactory, FileMessageDispatcherFactory, FtpMessageDispatcherFactory, HttpClientMessageDispatcherFactory, JbiMessageDispatcherFactory, JdbcMessageDispatcherFactory, JmsMessageDispatcherFactory, KeyedPoolMessageDispatcherFactoryAdapter, MulticastMessageDispatcherFactory, OracleJmsMessageDispatcherFactory, ProcessMessageDispatcherFactory, QuartzMessageDispatcherFactory, RetrieveMessageDispatcherFactory, RmiMessageDispatcherFactory, SmtpMessageDispatcherFactory, StreamMessageDispatcherFactory, TcpMessageDispatcherFactory, UdpMessageDispatcherFactory, VMMessageDispatcherFactory, XFireMessageDispatcherFactory, XFireWsdlMessageDispatcherFactory, XmppMessageDispatcherFactory

public interface UMOMessageDispatcherFactory

UMOMessageDispatcherFactory is a factory interface for managing the lifecycles of a transport's message dispatchers. The methods basically implement the KeyedPoolableObjectFactory lifecycle, with a UMOImmutableEndpoint as the key and the dispatcher as pooled object.


Method Summary
 void activate(UMOImmutableEndpoint endpoint, UMOMessageDispatcher dispatcher)
          Invoked before the given dispatcher is handed out to a client, but not after create(UMOImmutableEndpoint).
 UMOMessageDispatcher create(UMOImmutableEndpoint endpoint)
          Creates a new message dispatcher instance, initialised with the passed endpoint.
 void destroy(UMOImmutableEndpoint endpoint, UMOMessageDispatcher dispatcher)
          Invoked when a dispatcher returned false for validate(UMOImmutableEndpoint, UMOMessageDispatcher).
 boolean isCreateDispatcherPerRequest()
          Controls whether dispatchers are cached or created per request.
 void passivate(UMOImmutableEndpoint endpoint, UMOMessageDispatcher dispatcher)
          Invoked immediately before the given dispatcher is returned to its pool.
 boolean validate(UMOImmutableEndpoint endpoint, UMOMessageDispatcher dispatcher)
          Invoked after the dispatcher is returned from a client but before it is prepared for return to its pool via passivate(UMOImmutableEndpoint, UMOMessageDispatcher).
 

Method Detail

isCreateDispatcherPerRequest

boolean isCreateDispatcherPerRequest()
Controls whether dispatchers are cached or created per request. Note that if an exception occurs in the dispatcher, it is automatically disposed of and a new one is created for the next request. This allows dispatchers to recover from loss of connection and other faults. When invoked by validate(UMOImmutableEndpoint, UMOMessageDispatcher) it takes precedence over the dispatcher's own return value of UMOMessageDispatcher.validate().

Returns:
true if created per request

create

UMOMessageDispatcher create(UMOImmutableEndpoint endpoint)
                            throws UMOException
Creates a new message dispatcher instance, initialised with the passed endpoint. The returned instance should be immediately useable.

Parameters:
endpoint - the endoint for which this dispatcher should be created
Returns:
a properly created UMOMessageDispatcher for this transport
Throws:
UMOException - if the dispatcher cannot be created

activate

void activate(UMOImmutableEndpoint endpoint,
              UMOMessageDispatcher dispatcher)
              throws UMOException
Invoked before the given dispatcher is handed out to a client, but not after create(UMOImmutableEndpoint).

Parameters:
endpoint - the endpoint of the dispatcher
dispatcher - the dispatcher to be activated
Throws:
UMOException - if the dispatcher cannot be activated

validate

boolean validate(UMOImmutableEndpoint endpoint,
                 UMOMessageDispatcher dispatcher)
Invoked after the dispatcher is returned from a client but before it is prepared for return to its pool via passivate(UMOImmutableEndpoint, UMOMessageDispatcher).

Parameters:
endpoint - the endpoint of the dispatcher
dispatcher - the dispatcher to be validated
Returns:
true if the dispatcher is valid for reuse, false otherwise.

passivate

void passivate(UMOImmutableEndpoint endpoint,
               UMOMessageDispatcher dispatcher)
Invoked immediately before the given dispatcher is returned to its pool.

Parameters:
endpoint - the endpoint of the dispatcher
dispatcher - the dispatcher to be passivated

destroy

void destroy(UMOImmutableEndpoint endpoint,
             UMOMessageDispatcher dispatcher)
Invoked when a dispatcher returned false for validate(UMOImmutableEndpoint, UMOMessageDispatcher).

Parameters:
endpoint - the endpoint of the dispatcher
dispatcher - the dispatcher to be validated


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.