org.mule.transport
Class AbstractMessageRequesterFactory

java.lang.Object
  extended by org.mule.transport.AbstractMessageRequesterFactory
All Implemented Interfaces:
MessageRequesterFactory
Direct Known Subclasses:
AxisMessageRequesterFactory, CxfMessageRequesterFactory, FileMessageRequesterFactory, FtpMessageRequesterFactory, HttpClientMessageRequesterFactory, JdbcMessageRequesterFactory, JmsMessageRequesterFactory, RetrieveMessageRequesterFactory, TcpMessageRequesterFactory, UdpMessageRequesterFactory, UnsupportedMessageRequesterFactory, VMMessageRequesterFactory, XmppMessageRequesterFactory

public abstract class AbstractMessageRequesterFactory
extends Object
implements MessageRequesterFactory

A base implementation of the MessageRequesterFactory interface for managing the lifecycle of message requesters.

See Also:
MessageDispatcherFactory

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

Constructor Detail

AbstractMessageRequesterFactory

public AbstractMessageRequesterFactory()
Method Detail

isCreateRequesterPerRequest

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

Specified by:
isCreateRequesterPerRequest in interface MessageRequesterFactory
Returns:
false by default, unless overwritten by a subclass.

create

public abstract MessageRequester create(InboundEndpoint endpoint)
                                 throws MuleException
Description copied from interface: MessageRequesterFactory
Creates a new message requester instance, initialised with the passed endpoint. The returned instance should be immediately useable.

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

activate

public void activate(InboundEndpoint endpoint,
                     MessageRequester requester)
              throws MuleException
Description copied from interface: MessageRequesterFactory
Invoked before the given requester is handed out to a client, but not after MessageRequesterFactory.create(org.mule.api.endpoint.InboundEndpoint).

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

destroy

public void destroy(InboundEndpoint endpoint,
                    MessageRequester requester)
Description copied from interface: MessageRequesterFactory
Invoked when a requester returned false for MessageRequesterFactory.validate(org.mule.api.endpoint.InboundEndpoint, org.mule.api.transport.MessageRequester).

Specified by:
destroy in interface MessageRequesterFactory
Parameters:
endpoint - the endpoint of the requester
requester - the requester to be validated

passivate

public void passivate(InboundEndpoint endpoint,
                      MessageRequester requester)
Description copied from interface: MessageRequesterFactory
Invoked immediately before the given requester is returned to its pool.

Specified by:
passivate in interface MessageRequesterFactory
Parameters:
endpoint - the endpoint of the requester
requester - the requester to be passivated

validate

public boolean validate(InboundEndpoint endpoint,
                        MessageRequester requester)
Description copied from interface: MessageRequesterFactory
Invoked after the requester is returned from a client but before it is prepared for return to its pool via MessageRequesterFactory.passivate(org.mule.api.endpoint.InboundEndpoint, org.mule.api.transport.MessageRequester).

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

toString

public String toString()
Overrides:
toString in class Object


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