public interface MessageDispatcherFactory
MessageDispatcherFactory is a factory interface for managing the
lifecycles of a transport's message dispatchers. The methods basically implement
the KeyedPoolableObjectFactory lifecycle, with a
ImmutableEndpoint as the key and the dispatcher as pooled object.| Modifier and Type | Method and Description |
|---|---|
void |
activate(OutboundEndpoint endpoint,
MessageDispatcher dispatcher)
Invoked before the given dispatcher is handed out to a
client, but not after
create(OutboundEndpoint). |
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
validate(OutboundEndpoint, MessageDispatcher). |
boolean |
isCreateDispatcherPerRequest()
Controls whether dispatchers are cached or created per request.
|
void |
passivate(OutboundEndpoint endpoint,
MessageDispatcher dispatcher)
Invoked immediately before the given dispatcher is returned
to its pool.
|
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
passivate(OutboundEndpoint, MessageDispatcher). |
boolean isCreateDispatcherPerRequest()
validate(OutboundEndpoint, MessageDispatcher) it takes
precedence over the dispatcher's own return value of
MessageDispatcher.validate().MessageDispatcher create(OutboundEndpoint endpoint) throws MuleException
endpoint - the endoint for which this dispatcher should be createdMessageDispatcher for this
transportMuleException - if the dispatcher cannot be createdvoid activate(OutboundEndpoint endpoint, MessageDispatcher dispatcher) throws MuleException
create(OutboundEndpoint).endpoint - the endpoint of the dispatcherdispatcher - the dispatcher to be activatedMuleException - if the dispatcher cannot be activatedboolean validate(OutboundEndpoint endpoint, MessageDispatcher dispatcher)
passivate(OutboundEndpoint, MessageDispatcher).endpoint - the endpoint of the dispatcherdispatcher - the dispatcher to be validatedtrue if the dispatcher is valid for reuse,
false otherwise.void passivate(OutboundEndpoint endpoint, MessageDispatcher dispatcher)
endpoint - the endpoint of the dispatcherdispatcher - the dispatcher to be passivatedvoid destroy(OutboundEndpoint endpoint, MessageDispatcher dispatcher)
false for
validate(OutboundEndpoint, MessageDispatcher).endpoint - the endpoint of the dispatcherdispatcher - the dispatcher to be validatedCopyright © 2003–2015 MuleSoft, Inc.. All rights reserved.