org.mule.transport
Class AbstractMessageDispatcherFactory

java.lang.Object
  extended by org.mule.transport.AbstractMessageDispatcherFactory
All Implemented Interfaces:
MessageDispatcherFactory
Direct Known Subclasses:
AjaxMessageDispatcherFactory, AxisMessageDispatcherFactory, AxisWsdlMessageDispatcherFactory, EjbMessageDispatcherFactory, FileMessageDispatcherFactory, FtpMessageDispatcherFactory, HttpClientMessageDispatcherFactory, HttpsClientMessageDispatcherFactory, JdbcMessageDispatcherFactory, JmsMessageDispatcherFactory, LocalSocketTcpMessageDispatcherFactory, QuartzMessageDispatcherFactory, RmiMessageDispatcherFactory, SftpMessageDispatcherFactory, SmtpMessageDispatcherFactory, StdioMessageDispatcherFactory, TcpMessageDispatcherFactory, UdpMessageDispatcherFactory, UnsupportedMessageDispatcherFactory, VMMessageDispatcherFactory, XmppMessageDispatcherFactory

public abstract class AbstractMessageDispatcherFactory
extends Object
implements MessageDispatcherFactory

AbstractMessageDispatcherFactory is a base implementation of the MessageDispatcherFactory interface for managing the lifecycle of message dispatchers.

See Also:
MessageDispatcherFactory

Constructor Summary
AbstractMessageDispatcherFactory()
           
 
Method Summary
 void activate(OutboundEndpoint endpoint, MessageDispatcher dispatcher)
          Invoked before the given dispatcher is handed out to a client, but not after MessageDispatcherFactory.create(OutboundEndpoint).
abstract  MessageDispatcher create(OutboundEndpoint endpoint)
          Creates a new message dispatcher instance, initialised with the passed endpoint.
 void destroy(OutboundEndpoint endpoint, MessageDispatcher dispatcher)
          Invoked when a dispatcher returned false for MessageDispatcherFactory.validate(OutboundEndpoint, MessageDispatcher).
 boolean isCreateDispatcherPerRequest()
          This default implementation of MessageDispatcherFactory.isCreateDispatcherPerRequest() returns false, which means that dispatchers are pooled according to their lifecycle as described in MessageDispatcher.
 void passivate(OutboundEndpoint endpoint, MessageDispatcher dispatcher)
          Invoked immediately before the given dispatcher is returned to its pool.
 String toString()
           
 boolean validate(OutboundEndpoint endpoint, MessageDispatcher dispatcher)
          Invoked after the dispatcher is returned from a client but before it is prepared for return to its pool via MessageDispatcherFactory.passivate(OutboundEndpoint, MessageDispatcher).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractMessageDispatcherFactory

public AbstractMessageDispatcherFactory()
Method Detail

isCreateDispatcherPerRequest

public boolean isCreateDispatcherPerRequest()
This default implementation of MessageDispatcherFactory.isCreateDispatcherPerRequest() returns false, which means that dispatchers are pooled according to their lifecycle as described in MessageDispatcher.

Specified by:
isCreateDispatcherPerRequest in interface MessageDispatcherFactory
Returns:
false by default, unless overwritten by a subclass.

create

public abstract MessageDispatcher create(OutboundEndpoint endpoint)
                                  throws MuleException
Description copied from interface: MessageDispatcherFactory
Creates a new message dispatcher instance, initialised with the passed endpoint. The returned instance should be immediately useable.

Specified by:
create in interface MessageDispatcherFactory
Parameters:
endpoint - the endoint for which this dispatcher should be created
Returns:
a properly created MessageDispatcher for this transport
Throws:
MuleException - if the dispatcher cannot be created

activate

public void activate(OutboundEndpoint endpoint,
                     MessageDispatcher dispatcher)
              throws MuleException
Description copied from interface: MessageDispatcherFactory
Invoked before the given dispatcher is handed out to a client, but not after MessageDispatcherFactory.create(OutboundEndpoint).

Specified by:
activate in interface MessageDispatcherFactory
Parameters:
endpoint - the endpoint of the dispatcher
dispatcher - the dispatcher to be activated
Throws:
MuleException - if the dispatcher cannot be activated

destroy

public void destroy(OutboundEndpoint endpoint,
                    MessageDispatcher dispatcher)
Description copied from interface: MessageDispatcherFactory
Invoked when a dispatcher returned false for MessageDispatcherFactory.validate(OutboundEndpoint, MessageDispatcher).

Specified by:
destroy in interface MessageDispatcherFactory
Parameters:
endpoint - the endpoint of the dispatcher
dispatcher - the dispatcher to be validated

passivate

public void passivate(OutboundEndpoint endpoint,
                      MessageDispatcher dispatcher)
Description copied from interface: MessageDispatcherFactory
Invoked immediately before the given dispatcher is returned to its pool.

Specified by:
passivate in interface MessageDispatcherFactory
Parameters:
endpoint - the endpoint of the dispatcher
dispatcher - the dispatcher to be passivated

validate

public boolean validate(OutboundEndpoint endpoint,
                        MessageDispatcher dispatcher)
Description copied from interface: MessageDispatcherFactory
Invoked after the dispatcher is returned from a client but before it is prepared for return to its pool via MessageDispatcherFactory.passivate(OutboundEndpoint, MessageDispatcher).

Specified by:
validate in interface MessageDispatcherFactory
Parameters:
endpoint - the endpoint of the dispatcher
dispatcher - the dispatcher to be validated
Returns:
true if the dispatcher is valid for reuse, false otherwise.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.