|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mule.transport.AbstractConnector
public abstract class AbstractConnector
AbstractConnector
provides base functionality for all connectors
provided with Mule. Connectors are the mechanism used to connect to external
systems and protocols in order to send and receive data.
AbstractConnector
provides getter and setter methods for endpoint
name, transport name and protocol. It also provides methods to stop and start
connectors and sets up a dispatcher threadpool which allows deriving connectors
the possibility to dispatch work to separate threads. This functionality is
controlled with the doThreading property on the threadingProfiles for
dispatchers and receivers. The lifecycle for a connector is -
Field Summary | |
---|---|
protected boolean |
createMultipleTransactedReceivers
|
static int |
DEFAULT_NUM_CONCURRENT_TX_RECEIVERS
Default number of concurrent transactional receivers. |
protected MessageDispatcherFactory |
dispatcherFactory
Factory used to create dispatchers for this connector |
protected ConfigurableKeyedObjectPoolFactory |
dispatcherPoolFactory
A factory for creating the pool of dispatchers for this connector. |
protected ConfigurableKeyedObjectPool |
dispatchers
A pool of dispatchers for this connector, keyed by endpoint |
protected boolean |
initialStateStopped
The will cause the connector not to start when start() is called. |
protected ConnectorLifecycleManager |
lifecycleManager
|
protected Log |
logger
logger used by this class |
protected MuleContext |
muleContext
|
protected MuleMessageFactory |
muleMessageFactory
Factory used to create new MuleMessage instances |
protected String |
name
The name that identifies the endpoint |
protected int |
numberOfConcurrentTransactedReceivers
|
static String |
PROPERTY_POLLING_FREQUENCY
|
protected Map<Object,MessageReceiver> |
receivers
The collection of listeners on this connector. |
protected MessageRequesterFactory |
requesterFactory
Factory used to create requesters for this connector |
protected GenericKeyedObjectPool |
requesters
A pool of requesters for this connector, keyed by endpoint |
protected TransportServiceDescriptor |
serviceDescriptor
Holds the service configuration for this connector |
protected Properties |
serviceOverrides
The map of service overrides that can be used to extend the capabilities of the connector |
protected SessionHandler |
sessionHandler
The strategy used for reading and writing session information to and from the transport |
protected boolean |
startOnConnect
Indicates whether the connector should start upon connecting. |
Fields inherited from interface org.mule.api.transport.Connector |
---|
INT_VALUE_NOT_SET |
Fields inherited from interface org.mule.api.lifecycle.Disposable |
---|
PHASE_NAME |
Constructor Summary | |
---|---|
AbstractConnector(MuleContext context)
|
Method Summary | ||
---|---|---|
protected void |
clearDispatchers()
|
|
protected void |
clearRequesters()
|
|
protected void |
configureDispatcherPool()
|
|
void |
connect()
Make the connection to the underlying transport. |
|
AbstractRedeliveryPolicy |
createDefaultRedeliveryPolicy(int maxRedelivery)
|
|
MessageProcessor |
createDispatcherMessageProcessor(OutboundEndpoint endpoint)
|
|
MuleMessageFactory |
createMuleMessageFactory()
Create a MuleMessageFactory from this connector's configuration,
typically through the transport descriptor. |
|
protected
|
createOperationResource(ImmutableEndpoint endpoint)
|
|
protected MessageReceiver |
createReceiver(FlowConstruct flowConstruct,
InboundEndpoint endpoint)
Create a Message receiver for this connector |
|
protected ScheduledExecutorService |
createScheduler()
|
|
void |
destroyReceiver(MessageReceiver receiver,
ImmutableEndpoint endpoint)
|
|
void |
disconnect()
Disconnect the from the underlying transport |
|
void |
dispose()
A lifecycle method where implementor should free up any resources. |
|
protected void |
disposeReceivers()
|
|
protected void |
disposeWorkManagers()
|
|
protected abstract void |
doConnect()
Template method where any connections should be made for the connector |
|
protected abstract void |
doDisconnect()
Template method where any connected resources used by the connector should be disconnected |
|
protected abstract void |
doDispose()
Template method to perform any work when destroying the connectoe |
|
protected abstract void |
doInitialise()
|
|
protected abstract void |
doStart()
Template method to perform any work when starting the connectoe |
|
protected abstract void |
doStop()
Template method to perform any work when stopping the connectoe |
|
protected void |
doUnregisterListener(FlowConstruct flowConstruct,
InboundEndpoint endpoint,
MessageReceiver receiver)
|
|
void |
fireNotification(ServerNotification notification)
Fires a server notification to all registered listeners |
|
protected String |
getConnectEventId()
The resource id used when firing ConnectEvents from this connector |
|
String |
getConnectionDescription()
Returns a string identifying the underlying resource |
|
MessageExchangePattern |
getDefaultExchangePattern()
|
|
List<Transformer> |
getDefaultInboundTransformers(ImmutableEndpoint endpoint)
|
|
List<Transformer> |
getDefaultOutboundTransformers(ImmutableEndpoint endpoint)
|
|
List<Transformer> |
getDefaultResponseTransformers(ImmutableEndpoint endpoint)
|
|
MessageDispatcherFactory |
getDispatcherFactory()
The dispatcher factory is used to create a message dispatcher of the current request |
|
ConfigurableKeyedObjectPoolFactory |
getDispatcherPoolFactory()
|
|
ThreadingProfile |
getDispatcherThreadingProfile()
Getter for property 'dispatcherThreadingProfile'. |
|
protected WorkManager |
getDispatcherWorkManager()
Returns a work manager for message dispatchers. |
|
List<MessageExchangePattern> |
getInboundExchangePatterns()
|
|
LifecycleState |
getLifecycleState()
|
|
int |
getMaxDispatchersActive()
Returns the maximum number of dispatchers that can be concurrently active per endpoint. |
|
int |
getMaxRequestersActive()
Returns the maximum number of requesters that can be concurrently active per endpoint. |
|
int |
getMaxTotalDispatchers()
Returns the maximum number of dispatchers that can be concurrently active for all endpoints. |
|
MuleContext |
getMuleContext()
|
|
MuleMessageFactory |
getMuleMessageFactory()
The connector creates a MuleMessageFactory lazily and holds a reference to it for
others to use. |
|
String |
getName()
Gets the name of the object |
|
int |
getNumberOfConcurrentTransactedReceivers()
Returns the number of concurrent receivers that will be launched when isCreateMultipleTransactedReceivers() returns true . |
|
protected
|
getOperationResourceFactory()
|
|
List<MessageExchangePattern> |
getOutboundExchangePatterns()
|
|
OutputStream |
getOutputStream(OutboundEndpoint endpoint,
MuleEvent event)
Will get the output stream for this type of transport. |
|
MessageReceiver |
getReceiver(FlowConstruct flowConstruct,
InboundEndpoint endpoint)
|
|
protected Object |
getReceiverKey(FlowConstruct flowConstruct,
InboundEndpoint endpoint)
The method determines the key used to store the receiver against. |
|
Map<Object,MessageReceiver> |
getReceivers()
Getter for property 'receivers'. |
|
MessageReceiver[] |
getReceivers(String wildcardExpression)
|
|
ThreadingProfile |
getReceiverThreadingProfile()
Getter for property 'receiverThreadingProfile'. |
|
protected WorkManager |
getReceiverWorkManager()
Returns a work manager for message receivers. |
|
ReplyToHandler |
getReplyToHandler(ImmutableEndpoint endpoint)
Getter for property 'replyToHandler'. |
|
MessageRequesterFactory |
getRequesterFactory()
The requester factory is used to create a message requester of the current request |
|
ThreadingProfile |
getRequesterThreadingProfile()
Getter for property 'requesterThreadingProfile'. |
|
protected WorkManager |
getRequesterWorkManager()
Returns a work manager for message requesters. |
|
RetryPolicyTemplate |
getRetryPolicyTemplate()
|
|
ScheduledExecutorService |
getScheduler()
Returns a Scheduler service for periodic tasks, currently limited to internal use. |
|
protected TransportServiceDescriptor |
getServiceDescriptor()
Get the TransportServiceDescriptor for this connector. |
|
Map |
getServiceOverrides()
A map of fully qualified class names that should override those in the connectors' service descriptor This map will be null if there are no overrides |
|
SessionHandler |
getSessionHandler()
Getter for property 'sessionHandler'. |
|
List |
getSupportedProtocols()
Returns an unmodifiable list of the protocols supported by this connector |
|
|
getTransactionalResource(ImmutableEndpoint endpoint)
Returns transactional resource to use based on endpoint configuration and transactional context. |
|
protected void |
handleWorkException(javax.resource.spi.work.WorkEvent event,
String type)
|
|
protected void |
initFromServiceDescriptor()
Initialises this connector from its TransportServiceDescriptor This
will be called before the doInitialise() method is called. |
|
void |
initialise()
Method used to perform any initialisation work. |
|
void |
initialiseFromUrl(EndpointURI endpointUri)
When this connector is created via the TransportFactory the endpoint used to
determine the connector type is passed to this method so that any properties
set on the endpoint that can be used to initialise the connector are made
available. |
|
protected void |
initWorkManagers()
|
|
boolean |
isConnected()
Determines if this object is connected or not |
|
boolean |
isConnecting()
|
|
boolean |
isCreateMultipleTransactedReceivers()
For better throughput when using TransactedMessageReceivers this will enable a number of concurrent receivers, based on the value returned by getNumberOfConcurrentTransactedReceivers() . |
|
boolean |
isDisposed()
|
|
boolean |
isEnableMessageEvents()
|
|
boolean |
isInitialised()
|
|
boolean |
isInitialStateStopped()
The will cause the connector not to start when start() is called. |
|
boolean |
isResponseEnabled()
|
|
boolean |
isStarted()
|
|
boolean |
isStarting()
|
|
boolean |
isStopped()
|
|
boolean |
isStopping()
|
|
boolean |
isValidateConnections()
Whether to test a connection on each take from pool. |
|
MessageReceiver |
lookupReceiver(String key)
|
|
void |
registerListener(InboundEndpoint endpoint,
MessageProcessor messageProcessorChain,
FlowConstruct flowConstruct)
Registers a MessageProcessor listener which will listen to new message received from a specific transport channel and then processed by the endpoint. |
|
void |
registerSupportedMetaProtocol(String protocol)
Used by Meta endpoint descriptors to register support for endpoint of the meta endpoint type. |
|
void |
registerSupportedProtocol(String protocol)
Registers other protocols 'understood' by this connector. |
|
protected void |
registerSupportedProtocolWithoutPrefix(String protocol)
Registers other protocols 'understood' by this connector. |
|
MuleMessage |
request(InboundEndpoint endpoint,
long timeout)
Make a specific request to the underlying transport |
|
MuleMessage |
request(String uri,
long timeout)
Make a specific request to the underlying transport |
|
void |
setConnected(boolean flag)
|
|
void |
setConnecting(boolean flag)
|
|
void |
setCreateMultipleTransactedReceivers(boolean createMultipleTransactedReceivers)
|
|
void |
setDispatcherFactory(MessageDispatcherFactory dispatcherFactory)
The dispatcher factory is used to create a message dispatcher of the current request |
|
void |
setDispatcherPoolFactory(ConfigurableKeyedObjectPoolFactory dispatcherPoolFactory)
Allows to define a factory to create the dispatchers pool that will be used in the connector |
|
void |
setDispatcherPoolMaxWait(int maxWait)
Allows a maxWait timeout to be configured on the dispatcher object pool See: GenericKeyedObjectPool.setMaxWait(long) |
|
void |
setDispatcherPoolWhenExhaustedAction(byte whenExhaustedAction)
Allows an ExhaustedAction to be configured on the dispatcher object pool See: GenericKeyedObjectPool.setWhenExhaustedAction(byte) |
|
void |
setDispatcherThreadingProfile(ThreadingProfile dispatcherThreadingProfile)
Setter for property 'dispatcherThreadingProfile'. |
|
void |
setDynamicNotification(boolean dynamic)
|
|
void |
setInitialStateStopped(boolean initialStateStopped)
The will cause the connector not to start when start() is called. |
|
void |
setMaxDispatchersActive(int maxActive)
Configures the maximum number of dispatchers that can be concurrently active per endpoint |
|
void |
setMaxRequestersActive(int maxActive)
Configures the maximum number of requesters that can be concurrently active per endpoint |
|
void |
setName(String newName)
Sets the name of the object |
|
void |
setNumberOfConcurrentTransactedReceivers(int count)
|
|
void |
setReceiverThreadingProfile(ThreadingProfile receiverThreadingProfile)
Setter for property 'receiverThreadingProfile'. |
|
void |
setRequesterFactory(MessageRequesterFactory requesterFactory)
The requester factory is used to create a message requester of the current request |
|
void |
setRequesterPoolMaxWait(int maxWait)
Allows a maxWait timeout to be configured on the requester object pool See: GenericKeyedObjectPool.setMaxWait(long) |
|
void |
setRequesterPoolWhenExhaustedAction(byte whenExhaustedAction)
Allows an ExhaustedAction to be configured on the requester object pool See: GenericKeyedObjectPool.setWhenExhaustedAction(byte) |
|
void |
setRequesterThreadingProfile(ThreadingProfile requesterThreadingProfile)
Setter for property 'requesterThreadingProfile'. |
|
void |
setRetryPolicyTemplate(RetryPolicyTemplate retryPolicyTemplate)
|
|
void |
setServiceOverrides(Map serviceOverrides)
Set the Service overrides on this connector. |
|
void |
setSessionHandler(SessionHandler sessionHandler)
Setter for property 'sessionHandler'. |
|
void |
setSupportedProtocols(List supportedProtocols)
Sets A list of protocols that the connector can accept |
|
protected void |
setupDispatchReturn(OutboundEndpoint endpoint,
MessageDispatcher dispatcher,
MuleMessage result)
This method will return the dispatcher to the pool or, if the payload is an inputstream, replace the payload with a new DelegatingInputStream which returns the dispatcher to the pool when the stream is closed. |
|
protected void |
setupRequestReturn(InboundEndpoint endpoint,
MessageRequester requester,
MuleMessage result)
This method will return the requester to the pool or, if the payload is an inputstream, replace the payload with a new DelegatingInputStream which returns the requester to the pool when the stream is closed. |
|
void |
setValidateConnections(boolean validateConnections)
Whether to test a connection on each take. |
|
protected void |
shutdownScheduler()
|
|
void |
start()
|
|
protected void |
startAfterConnect()
|
|
void |
stop()
|
|
boolean |
supportsProtocol(String protocol)
|
|
String |
toString()
|
|
void |
unregisterListener(InboundEndpoint endpoint,
FlowConstruct flowConstruct)
Unregisters the listener for the given endpoints. |
|
void |
unregisterSupportedProtocol(String protocol)
|
|
protected void |
updateCachedNotificationHandler()
|
|
RetryContext |
validateConnection(RetryContext retryContext)
Override this method to test whether the connector is able to connect to its resource(s). |
|
void |
workAccepted(javax.resource.spi.work.WorkEvent event)
|
|
void |
workCompleted(javax.resource.spi.work.WorkEvent event)
|
|
void |
workRejected(javax.resource.spi.work.WorkEvent event)
|
|
void |
workStarted(javax.resource.spi.work.WorkEvent event)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.mule.api.transport.Connector |
---|
getProtocol |
Field Detail |
---|
public static final int DEFAULT_NUM_CONCURRENT_TX_RECEIVERS
public static final String PROPERTY_POLLING_FREQUENCY
protected final Log logger
protected volatile String name
protected volatile MessageDispatcherFactory dispatcherFactory
protected volatile MessageRequesterFactory requesterFactory
protected MuleMessageFactory muleMessageFactory
MuleMessage
instances
protected volatile ConfigurableKeyedObjectPool dispatchers
protected volatile ConfigurableKeyedObjectPoolFactory dispatcherPoolFactory
protected final GenericKeyedObjectPool requesters
protected final Map<Object,MessageReceiver> receivers
protected volatile boolean createMultipleTransactedReceivers
isCreateMultipleTransactedReceivers()
protected volatile int numberOfConcurrentTransactedReceivers
getNumberOfConcurrentTransactedReceivers()
protected volatile TransportServiceDescriptor serviceDescriptor
protected volatile Properties serviceOverrides
protected volatile SessionHandler sessionHandler
protected MuleContext muleContext
protected ConnectorLifecycleManager lifecycleManager
protected boolean startOnConnect
protected boolean initialStateStopped
start()
is called. The
only way to start the connector is to call
setInitialStateStopped(boolean)
with 'false' and then calling
start()
. This flag is used internally since some connectors that rely
on external servers may need to wait for that server to become available
before starting
Constructor Detail |
---|
public AbstractConnector(MuleContext context)
Method Detail |
---|
public String getName()
NamedObject
getName
in interface NamedObject
public void setName(String newName)
NameableObject
setName
in interface NameableObject
newName
- the name of the objectpublic LifecycleState getLifecycleState()
getLifecycleState
in interface LifecycleStateEnabled
public final void initialise() throws InitialisationException
Initialisable
InitialisationException
should be thrown,
causing the Mule instance to shutdown. If the error is recoverable, say by
retrying to connect, a RecoverableException
should be thrown.
There is no guarantee that by throwing a Recoverable exception that the Mule
instance will not shut down.
initialise
in interface Initialisable
InitialisationException
- if a fatal error occurs causing the Mule instance to shutdown
RecoverableException
- if an error occurs that can be recovered frompublic final void start() throws MuleException
start
in interface Startable
MuleException
protected void startAfterConnect() throws MuleException
MuleException
public final void stop() throws MuleException
stop
in interface Stoppable
MuleException
public final void dispose()
Disposable
dispose
in interface Disposable
public final boolean isStarted()
isStarted
in interface Connector
public final boolean isStarting()
public boolean isInitialised()
public boolean isStopped()
public boolean isStopping()
protected void configureDispatcherPool()
public MuleMessageFactory createMuleMessageFactory() throws CreateException
Create a MuleMessageFactory
from this connector's configuration,
typically through the transport descriptor.
MuleMessage
instances.
createMuleMessageFactory
in interface Connector
CreateException
MessageReceiver.createMuleMessage(Object)
,
MessageReceiver.createMuleMessage(Object, String)
protected void shutdownScheduler()
protected void initWorkManagers() throws MuleException
MuleException
protected void disposeWorkManagers()
protected void disposeReceivers()
protected void clearDispatchers()
protected void clearRequesters()
public boolean isDisposed()
isDisposed
in interface Connector
public MessageDispatcherFactory getDispatcherFactory()
Connector
getDispatcherFactory
in interface Connector
public void setDispatcherFactory(MessageDispatcherFactory dispatcherFactory)
Connector
setDispatcherFactory
in interface Connector
dispatcherFactory
- The dispatcherFactory to set.public MessageRequesterFactory getRequesterFactory()
Connector
getRequesterFactory
in interface Connector
public void setRequesterFactory(MessageRequesterFactory requesterFactory)
Connector
setRequesterFactory
in interface Connector
requesterFactory
- The requesterFactory to set.public MuleMessageFactory getMuleMessageFactory() throws CreateException
The connector creates a MuleMessageFactory
lazily and holds a reference to it for
others to use.
The typical use case is to share a single MuleMessageFactory
between all
MessageDispatcher
, MessageReceiver
and MessageRequester
instances
belonging to this connector.
CreateException
public boolean isInitialStateStopped()
start()
is called. The
only way to start the connector is to call
setInitialStateStopped(boolean)
with 'false' and then calling
start()
. This flag is used internally since some connectors that rely
on external servers may need to wait for that server to become available
before starting.
public void setInitialStateStopped(boolean initialStateStopped)
start()
is called. The
only way to start the connector is to call
setInitialStateStopped(boolean)
with 'false' and then calling
start()
. This flag is used internally since some connectors that rely
on external servers may need to wait for that server to become available
before starting. The only time this method should be used is when a
subclassing connector needs to delay the start lifecycle due to a dependence
on an external system. Most users can ignore this.
initialStateStopped
- true to stop the connector starting through normal lifecycle. It will
be the responsibility of the code that sets this property to start the
connectorpublic int getMaxDispatchersActive()
public int getMaxTotalDispatchers()
public void setMaxDispatchersActive(int maxActive)
maxActive
- max. number of active dispatcherspublic int getMaxRequestersActive()
public void setMaxRequestersActive(int maxActive)
maxActive
- max. number of active requesterspublic void registerListener(InboundEndpoint endpoint, MessageProcessor messageProcessorChain, FlowConstruct flowConstruct) throws Exception
Connector
registerListener
in interface Connector
endpoint
- defines both the transport and channel/resource uri as well
the processing (transformation/filtering) that should occur when
the endpoint processes a new message from the transport receiver.messageProcessorChain
- the listener that will be invoked when messages are received
on the endpoint.flowConstruct
- reference to the flow construct that the listener is part
of for use as context for logging, notifications and error
handling.
Exception
protected Object getReceiverKey(FlowConstruct flowConstruct, InboundEndpoint endpoint)
flowConstruct
- the service for which the endpoint is being registeredendpoint
- the endpoint being registered for the service
public final void unregisterListener(InboundEndpoint endpoint, FlowConstruct flowConstruct) throws Exception
Connector
unregisterListener
in interface Connector
Exception
protected void doUnregisterListener(FlowConstruct flowConstruct, InboundEndpoint endpoint, MessageReceiver receiver)
public ThreadingProfile getDispatcherThreadingProfile()
public void setDispatcherThreadingProfile(ThreadingProfile dispatcherThreadingProfile)
dispatcherThreadingProfile
- Value to set for property
'dispatcherThreadingProfile'.public ThreadingProfile getRequesterThreadingProfile()
public void setRequesterThreadingProfile(ThreadingProfile requesterThreadingProfile)
requesterThreadingProfile
- Value to set for property
'requesterThreadingProfile'.public ThreadingProfile getReceiverThreadingProfile()
public void setReceiverThreadingProfile(ThreadingProfile receiverThreadingProfile)
receiverThreadingProfile
- Value to set for property
'receiverThreadingProfile'.public void destroyReceiver(MessageReceiver receiver, ImmutableEndpoint endpoint) throws Exception
Exception
protected abstract void doInitialise() throws InitialisationException
InitialisationException
protected abstract void doDispose()
protected abstract void doStart() throws MuleException
MuleException
- if the method failsprotected abstract void doStop() throws MuleException
MuleException
- if the method failspublic List<Transformer> getDefaultInboundTransformers(ImmutableEndpoint endpoint)
public List<Transformer> getDefaultResponseTransformers(ImmutableEndpoint endpoint)
public List<Transformer> getDefaultOutboundTransformers(ImmutableEndpoint endpoint)
public ReplyToHandler getReplyToHandler(ImmutableEndpoint endpoint)
public void fireNotification(ServerNotification notification)
notification
- the notification to fire.public boolean isResponseEnabled()
isResponseEnabled
in interface Connector
public MessageReceiver getReceiver(FlowConstruct flowConstruct, InboundEndpoint endpoint)
public Map<Object,MessageReceiver> getReceivers()
public MessageReceiver lookupReceiver(String key)
public MessageReceiver[] getReceivers(String wildcardExpression)
public void connect() throws Exception
Connectable
connect
in interface Connectable
Exception
public RetryContext validateConnection(RetryContext retryContext)
validateConnection
in interface Connectable
RetryContext.isOk()
,
RetryContext.getLastFailure()
public void disconnect() throws Exception
Connectable
disconnect
in interface Connectable
Exception
public String getConnectionDescription()
Connectable
getConnectionDescription
in interface Connectable
public final boolean isConnected()
Connectable
isConnected
in interface Connectable
isConnected
in interface Connector
public final void setConnected(boolean flag)
public final void setConnecting(boolean flag)
public final boolean isConnecting()
protected abstract void doConnect() throws Exception
Exception
protected abstract void doDisconnect() throws Exception
Exception
protected String getConnectEventId()
public boolean isCreateMultipleTransactedReceivers()
getNumberOfConcurrentTransactedReceivers()
. This property is used by
transports that support transactions, specifically receivers that extend the
TransactedPollingMessageReceiver.
public void setCreateMultipleTransactedReceivers(boolean createMultipleTransactedReceivers)
createMultipleTransactedReceivers
- if true, multiple receivers will be
created for this connectionisCreateMultipleTransactedReceivers()
public int getNumberOfConcurrentTransactedReceivers()
isCreateMultipleTransactedReceivers()
returns true
.
DEFAULT_NUM_CONCURRENT_TX_RECEIVERS
public void setNumberOfConcurrentTransactedReceivers(int count)
count
- the number of concurrent transacted receivers to startgetNumberOfConcurrentTransactedReceivers()
public void setDynamicNotification(boolean dynamic)
protected void updateCachedNotificationHandler()
public boolean isEnableMessageEvents()
public void registerSupportedProtocol(String protocol)
protocol
- the supported protocol to registerpublic void registerSupportedMetaProtocol(String protocol)
protocol
- the meta protocol that can be used with this connectorprotected void registerSupportedProtocolWithoutPrefix(String protocol)
registerSupportedProtocol(String)
method, this allows you to register protocols that are not prefixed with the
connector protocol. This is useful where you use a Service Finder to discover
which Transport implementation to use. For example the 'wsdl' transport is a
generic 'finder' transport that will use Axis or CXF to create the WSDL
client. These transport protocols would be wsdl-axis and wsdl-cxf, but they
can all support 'wsdl' protocol too.
protocol
- the supported protocol to registerpublic void unregisterSupportedProtocol(String protocol)
public boolean supportsProtocol(String protocol)
supportsProtocol
in interface Connector
public List getSupportedProtocols()
public void setSupportedProtocols(List supportedProtocols)
supportedProtocols
- protected WorkManager getReceiverWorkManager() throws MuleException
MuleException
protected WorkManager getDispatcherWorkManager() throws MuleException
MuleException
- in case of errorprotected WorkManager getRequesterWorkManager() throws MuleException
MuleException
- in case of errorpublic ScheduledExecutorService getScheduler()
protected ScheduledExecutorService createScheduler()
public SessionHandler getSessionHandler()
getSessionHandler
in interface Connector
public AbstractRedeliveryPolicy createDefaultRedeliveryPolicy(int maxRedelivery)
createDefaultRedeliveryPolicy
in interface Connector
maxRedelivery
- times to try message redelivery
public final <T> T getTransactionalResource(ImmutableEndpoint endpoint) throws MuleException
T
- Type of the transaction resourceendpoint
- which holds the transaction configuration
MuleException
protected <T> T createOperationResource(ImmutableEndpoint endpoint) throws MuleException
MuleException
protected <T> T getOperationResourceFactory()
public void setSessionHandler(SessionHandler sessionHandler)
sessionHandler
- Value to set for property 'sessionHandler'.public void workAccepted(javax.resource.spi.work.WorkEvent event)
workAccepted
in interface javax.resource.spi.work.WorkListener
public void workRejected(javax.resource.spi.work.WorkEvent event)
workRejected
in interface javax.resource.spi.work.WorkListener
public void workStarted(javax.resource.spi.work.WorkEvent event)
workStarted
in interface javax.resource.spi.work.WorkListener
public void workCompleted(javax.resource.spi.work.WorkEvent event)
workCompleted
in interface javax.resource.spi.work.WorkListener
protected void handleWorkException(javax.resource.spi.work.WorkEvent event, String type)
protected void setupDispatchReturn(OutboundEndpoint endpoint, MessageDispatcher dispatcher, MuleMessage result)
endpoint
- dispatcher
- result
- public MuleMessage request(String uri, long timeout) throws Exception
Connector
request
in interface Connector
uri
- the endpoint uri to use when connecting to the resourcetimeout
- the maximum time the operation should block before returning.
The call should return immediately if there is data available. If
no data becomes available before the timeout elapses, null will be
returned
Exception
- if the call to the underlying protocal cuases an exceptionpublic MuleMessage request(InboundEndpoint endpoint, long timeout) throws Exception
Connector
request
in interface Connector
endpoint
- the endpoint to use when connecting to the resourcetimeout
- the maximum time the operation should block before returning.
The call should return immediately if there is data available. If
no data becomes available before the timeout elapses, null will be
returned
Exception
- if the call to the underlying protocal cuases an exceptionprotected void setupRequestReturn(InboundEndpoint endpoint, MessageRequester requester, MuleMessage result)
endpoint
- requester
- result
- public void initialiseFromUrl(EndpointURI endpointUri) throws InitialisationException
TransportFactory
the endpoint used to
determine the connector type is passed to this method so that any properties
set on the endpoint that can be used to initialise the connector are made
available.
endpointUri
- the EndpointURI
use to create this connector
InitialisationException
- If there are any problems with the
configuration set on the Endpoint or if another exception is
thrown it is wrapped in an InitialisationException.protected void initFromServiceDescriptor() throws InitialisationException
TransportServiceDescriptor
This
will be called before the doInitialise()
method is called.
InitialisationException
- InitialisationException If there are any
problems with the configuration or if another exception is thrown
it is wrapped in an InitialisationException.protected TransportServiceDescriptor getServiceDescriptor()
TransportServiceDescriptor
for this connector. This will be
null if the connector was created by the developer. To create a connector the
proper way the developer should use the TransportFactory
and pass in
an endpoint.
TransportServiceDescriptor
for this connectorprotected MessageReceiver createReceiver(FlowConstruct flowConstruct, InboundEndpoint endpoint) throws Exception
flowConstruct
- the service that will receive events from this receiver, the
listenerendpoint
- the endpoint that defies this inbound communication
TransportServiceDescriptor
initialised using the service and endpoint.
Exception
- if there is a problem creating the receiver. This exception
really depends on the underlying transport, thus any exception
could be thrownpublic Map getServiceOverrides()
public void setServiceOverrides(Map serviceOverrides)
serviceOverrides
- the override values to usepublic OutputStream getOutputStream(OutboundEndpoint endpoint, MuleEvent event) throws MuleException
UnsupportedOperationException
is
thrown. Note that the stream MUST release resources on close. For help doing
so, see CallbackOutputStream
.
getOutputStream
in interface Connector
endpoint
- the endpoint that releates to this Dispatcherevent
- the current event being processed
MuleException
- in case of any errorpublic MuleContext getMuleContext()
getMuleContext
in interface Connector
public String toString()
toString
in class Object
public RetryPolicyTemplate getRetryPolicyTemplate()
getRetryPolicyTemplate
in interface Connector
public void setRetryPolicyTemplate(RetryPolicyTemplate retryPolicyTemplate)
public boolean isValidateConnections()
public void setValidateConnections(boolean validateConnections)
true
public void setDispatcherPoolWhenExhaustedAction(byte whenExhaustedAction)
GenericKeyedObjectPool.setWhenExhaustedAction(byte)
public void setDispatcherPoolMaxWait(int maxWait)
GenericKeyedObjectPool.setMaxWait(long)
public void setDispatcherPoolFactory(ConfigurableKeyedObjectPoolFactory dispatcherPoolFactory)
public ConfigurableKeyedObjectPoolFactory getDispatcherPoolFactory()
public void setRequesterPoolWhenExhaustedAction(byte whenExhaustedAction)
GenericKeyedObjectPool.setWhenExhaustedAction(byte)
public void setRequesterPoolMaxWait(int maxWait)
GenericKeyedObjectPool.setMaxWait(long)
public MessageProcessor createDispatcherMessageProcessor(OutboundEndpoint endpoint) throws MuleException
MuleException
public MessageExchangePattern getDefaultExchangePattern()
getDefaultExchangePattern
in interface Connector
MessageExchangePattern
as configured in the
transport's service descriptor.public List<MessageExchangePattern> getInboundExchangePatterns()
getInboundExchangePatterns
in interface Connector
public List<MessageExchangePattern> getOutboundExchangePatterns()
getOutboundExchangePatterns
in interface Connector
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |