public interface Connector extends Lifecycle, MuleContextAware, NamedObject
Connector
is the mechanism used to connect to external systems
and protocols in order to send and receive data.Modifier and Type | Field and Description |
---|---|
static int |
INT_VALUE_NOT_SET |
PHASE_NAME
PHASE_NAME
PHASE_NAME
PHASE_NAME
Modifier and Type | Method and Description |
---|---|
void |
dispatch(OutboundEndpoint endpoint,
MuleEvent event)
Dispatches an event from the endpoint to the external system
|
MessageDispatcherFactory |
getDispatcherFactory()
The dispatcher factory is used to create a message dispatcher of the current
request
|
ExceptionListener |
getExceptionListener() |
MessageAdapter |
getMessageAdapter(Object message)
Gets a
MessageAdapter from the connector for the given message
(data) |
MuleContext |
getMuleContext() |
OutputStream |
getOutputStream(OutboundEndpoint endpoint,
MuleMessage message)
Will get the output stream for this type of transport.
|
String |
getProtocol() |
MessageRequesterFactory |
getRequesterFactory()
The requester factory is used to create a message requester of the current
request
|
void |
handleException(Exception exception) |
boolean |
isDisposed() |
boolean |
isDisposing() |
boolean |
isRemoteSyncEnabled() |
boolean |
isStarted() |
boolean |
isSyncEnabled(String protocol)
Used to define is this connectors endpoints' should be synchronous by default rather than
using Mule's instance wide default.
|
MessageReceiver |
registerListener(Service service,
InboundEndpoint endpoint)
This creates a
MessageReceiver associated with this endpoint
and registers it with the connector |
MuleMessage |
request(InboundEndpoint endpoint,
long timeout)
Make a specific request to the underlying transport
|
MuleMessage |
request(String uri,
long timeout)
Deprecated.
Use request(ImmutableEndpoint endpoint, long timeout)
|
MuleMessage |
send(OutboundEndpoint endpoint,
MuleEvent event)
Sends an event from the endpoint to the external system
|
void |
setDispatcherFactory(MessageDispatcherFactory factory)
The dispatcher factory is used to create a message dispatcher of the current
request
|
void |
setExceptionListener(ExceptionListener listener) |
void |
setRequesterFactory(MessageRequesterFactory factory)
The requester factory is used to create a message requester of the current
request
|
boolean |
supportsProtocol(String protocol) |
void |
unregisterListener(Service service,
InboundEndpoint endpoint) |
initialise
dispose
setMuleContext
getName, setName
static final int INT_VALUE_NOT_SET
MessageReceiver registerListener(Service service, InboundEndpoint endpoint) throws Exception
MessageReceiver
associated with this endpoint
and registers it with the connectorservice
- the listening serviceendpoint
- the endpoint contains the listener endpointUri on which to
listen on.Exception
- if the MessageReceiver cannot be created or the Receiver
cannot be registeredvoid unregisterListener(Service service, InboundEndpoint endpoint) throws Exception
service
- the listening serviceendpoint
- the associated endpointDescriptor with the listenerException
- if the listener cannot be unregistered. If a listener is not
associated with the given endpoint this will not throw an
exceptionboolean isStarted()
boolean isDisposed()
boolean isDisposing()
MessageAdapter getMessageAdapter(Object message) throws MessagingException
MessageAdapter
from the connector for the given message
(data)message
- the data with which to initialise the MessageAdapter
MessageAdapter
for the endpointMessagingException
- if the message parameter is not supportedMessageAdapter
String getProtocol()
boolean supportsProtocol(String protocol)
void setExceptionListener(ExceptionListener listener)
listener
- the exception strategy to use with this endpointExceptionListener
ExceptionListener getExceptionListener()
ExceptionListener
void handleException(Exception exception)
exception
- the exception that was caughtvoid setDispatcherFactory(MessageDispatcherFactory factory)
factory
- the factory to use when a dispatcher request is madrMessageDispatcherFactory getDispatcherFactory()
void setRequesterFactory(MessageRequesterFactory factory)
factory
- the factory to use when a request is madeMessageRequesterFactory getRequesterFactory()
boolean isRemoteSyncEnabled()
boolean isSyncEnabled(String protocol)
endpoint
- ImmutableEndpoint#isSynchronous()
void dispatch(OutboundEndpoint endpoint, MuleEvent event) throws DispatchException
event
- The event to dispatchDispatchException
- if the event fails to be dispatchedMuleMessage request(String uri, long timeout) throws Exception
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
returnedException
- if the call to the underlying protocal cuases an exceptionMuleMessage request(InboundEndpoint endpoint, long timeout) throws Exception
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
returnedException
- if the call to the underlying protocal cuases an exceptionMuleMessage send(OutboundEndpoint endpoint, MuleEvent event) throws DispatchException
event
- The event to sendDispatchException
- if the event fails to be dispatchedOutputStream getOutputStream(OutboundEndpoint endpoint, MuleMessage message) throws MuleException
UnsupportedOperationException
is thrown. Note that the stream MUST release resources on close. For help doing so, see
CallbackOutputStream
.endpoint
- the endpoint that releates to this Dispatchermessage
- the current message being processedMuleException
MuleContext getMuleContext()
Copyright © 2003–2013 MuleSource, Inc.. All rights reserved.