public abstract class AbstractMessageDispatcherFactory extends Object implements MessageDispatcherFactory
AbstractMessageDispatcherFactory
is a base implementation of the
MessageDispatcherFactory
interface for managing the lifecycle of
message dispatchers.MessageDispatcherFactory
Constructor and Description |
---|
AbstractMessageDispatcherFactory() |
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
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) . |
public boolean isCreateDispatcherPerRequest()
MessageDispatcherFactory.isCreateDispatcherPerRequest()
returns
false
, which means that dispatchers are pooled according to
their lifecycle as described in MessageDispatcher
.isCreateDispatcherPerRequest
in interface MessageDispatcherFactory
false
by default, unless overwritten by a subclass.public abstract MessageDispatcher create(OutboundEndpoint endpoint) throws MuleException
MessageDispatcherFactory
create
in interface MessageDispatcherFactory
endpoint
- the endoint for which this dispatcher should be createdMessageDispatcher
for this
transportMuleException
- if the dispatcher cannot be createdpublic void activate(OutboundEndpoint endpoint, MessageDispatcher dispatcher) throws MuleException
MessageDispatcherFactory
MessageDispatcherFactory.create(OutboundEndpoint)
.activate
in interface MessageDispatcherFactory
endpoint
- the endpoint of the dispatcherdispatcher
- the dispatcher to be activatedMuleException
- if the dispatcher cannot be activatedpublic void destroy(OutboundEndpoint endpoint, MessageDispatcher dispatcher)
MessageDispatcherFactory
false
for
MessageDispatcherFactory.validate(OutboundEndpoint, MessageDispatcher)
.destroy
in interface MessageDispatcherFactory
endpoint
- the endpoint of the dispatcherdispatcher
- the dispatcher to be validatedpublic void passivate(OutboundEndpoint endpoint, MessageDispatcher dispatcher)
MessageDispatcherFactory
passivate
in interface MessageDispatcherFactory
endpoint
- the endpoint of the dispatcherdispatcher
- the dispatcher to be passivatedpublic boolean validate(OutboundEndpoint endpoint, MessageDispatcher dispatcher)
MessageDispatcherFactory
MessageDispatcherFactory.passivate(OutboundEndpoint, MessageDispatcher)
.validate
in interface MessageDispatcherFactory
endpoint
- the endpoint of the dispatcherdispatcher
- the dispatcher to be validatedtrue
if the dispatcher is valid for reuse,
false
otherwise.Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.