org.mule.api.transport
Interface MessageRequesterFactory

All Known Implementing Classes:
AbstractMessageRequesterFactory, AxisMessageRequesterFactory, FileMessageRequesterFactory, FtpMessageRequesterFactory, HttpClientMessageRequesterFactory, JdbcMessageRequesterFactory, JmsMessageRequesterFactory, KeyedPoolMessageRequesterFactoryAdapter, RetrieveMessageRequesterFactory, SftpMessageRequesterFactory, TcpMessageRequesterFactory, UdpMessageRequesterFactory, UnsupportedMessageRequesterFactory, VMMessageRequesterFactory, XmppMessageRequesterFactory

public interface MessageRequesterFactory

A factory interface for managing the lifecycles of a transport's message requesters. The methods basically implement the KeyedPoolableObjectFactory lifecycle, with a InboundEndpoint as the key and the requester as pooled object.


Method Summary
 void activate(InboundEndpoint endpoint, MessageRequester requester)
          Invoked before the given requester is handed out to a client, but not after create(org.mule.api.endpoint.InboundEndpoint).
 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 validate(org.mule.api.endpoint.InboundEndpoint, org.mule.api.transport.MessageRequester).
 boolean isCreateRequesterPerRequest()
          Controls whether dispatchers are cached or created per request.
 void passivate(InboundEndpoint endpoint, MessageRequester requester)
          Invoked immediately before the given requester is returned to its pool.
 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 passivate(org.mule.api.endpoint.InboundEndpoint, org.mule.api.transport.MessageRequester).
 

Method Detail

isCreateRequesterPerRequest

boolean isCreateRequesterPerRequest()
Controls whether dispatchers are cached or created per request. Note that if an exception occurs in the requester, it is automatically disposed of and a new one is created for the next request. This allows requesters to recover from loss of connection and other faults. When invoked by validate(org.mule.api.endpoint.InboundEndpoint, org.mule.api.transport.MessageRequester) it takes precedence over the dispatcher's own return value of MessageDispatcher.validate().

Returns:
true if created per request

create

MessageRequester create(InboundEndpoint endpoint)
                        throws MuleException
Creates a new message requester instance, initialised with the passed endpoint. The returned instance should be immediately useable.

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

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

Parameters:
endpoint - the endpoint of the requester
requester - the requester to be activated
Throws:
MuleException - if the requester cannot be activated

validate

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 passivate(org.mule.api.endpoint.InboundEndpoint, org.mule.api.transport.MessageRequester).

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

passivate

void passivate(InboundEndpoint endpoint,
               MessageRequester requester)
Invoked immediately before the given requester is returned to its pool.

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

destroy

void destroy(InboundEndpoint endpoint,
             MessageRequester requester)
Invoked when a requester returned false for validate(org.mule.api.endpoint.InboundEndpoint, org.mule.api.transport.MessageRequester).

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


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