|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface UMOConnector
UMOConnector
is the mechanism used to connect to external systems
and protocols in order to send and receive data.
Field Summary | |
---|---|
static int |
INT_VALUE_NOT_SET
|
Method Summary | |
---|---|
void |
dispatch(UMOImmutableEndpoint endpoint,
UMOEvent event)
Dispatches an event from the endpoint to the external system |
UMOMessageDispatcherFactory |
getDispatcherFactory()
The dispatcher factory is used to create a message dispatcher of the current request |
ExceptionListener |
getExceptionListener()
|
UMOMessageAdapter |
getMessageAdapter(Object message)
Gets a UMOMessageAdapter from the connector for the given message
(data) |
String |
getName()
|
OutputStream |
getOutputStream(UMOImmutableEndpoint endpoint,
UMOMessage message)
Will get the output stream for this type of transport. |
String |
getProtocol()
|
ScheduledExecutorService |
getScheduler()
Returns a Scheduler service for execution of periodic tasks. |
UMOStreamMessageAdapter |
getStreamMessageAdapter(InputStream in,
OutputStream out)
Gets a UMOStreamMessageAdapter from the connector for the given
message. |
void |
handleException(Exception exception)
|
boolean |
isDisposed()
|
boolean |
isDisposing()
|
boolean |
isRemoteSyncEnabled()
|
boolean |
isStarted()
|
UMOMessage |
receive(UMOEndpointURI endpointUri,
long timeout)
Deprecated. Use receive(UMOImmutableEndpoint endpoint, long timeout) |
UMOMessage |
receive(UMOImmutableEndpoint endpoint,
long timeout)
Make a specific request to the underlying transport |
UMOMessageReceiver |
registerListener(UMOComponent component,
UMOEndpoint endpoint)
This creates a UMOMessageReceiver associated with this endpoint
and registers it with the connector. |
UMOMessage |
send(UMOImmutableEndpoint endpoint,
UMOEvent event)
Sends an event from the endpoint to the external system |
void |
setDispatcherFactory(UMOMessageDispatcherFactory factory)
The dispatcher factory is used to create a message dispatcher of the current request |
void |
setExceptionListener(ExceptionListener listener)
|
void |
setName(String newName)
|
void |
startConnector()
|
void |
stopConnector()
|
boolean |
supportsProtocol(String protocol)
|
void |
unregisterListener(UMOComponent component,
UMOEndpoint endpoint)
|
Methods inherited from interface org.mule.umo.lifecycle.Disposable |
---|
dispose |
Methods inherited from interface org.mule.umo.lifecycle.Initialisable |
---|
initialise |
Field Detail |
---|
static final int INT_VALUE_NOT_SET
Method Detail |
---|
UMOMessageReceiver registerListener(UMOComponent component, UMOEndpoint endpoint) throws Exception
UMOMessageReceiver
associated with this endpoint
and registers it with the connector.
component
- the listening componentendpoint
- the endpoint contains the listener endpointUri on which to
listen on.
Exception
- if the UMOMessageReceiver cannot be created or the Receiver
cannot be registeredvoid unregisterListener(UMOComponent component, UMOEndpoint endpoint) throws Exception
component
- the listening componentendpoint
- the associated endpointDescriptor with the listener
Exception
- 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()
UMOMessageAdapter getMessageAdapter(Object message) throws MessagingException
UMOMessageAdapter
from the connector for the given message
(data)
message
- the data with which to initialise the UMOMessageAdapter
UMOMessageAdapter
for the endpoint
MessagingException
- if the message parameter is not supportedUMOMessageAdapter
UMOStreamMessageAdapter getStreamMessageAdapter(InputStream in, OutputStream out) throws MessagingException
UMOStreamMessageAdapter
from the connector for the given
message. This Adapter will correctly handle data streaming for this type of
connector
in
- the input stream to read the data fromout
- the outputStream to write data to. This can be null.
UMOStreamMessageAdapter
for the endpoint
MessagingException
- if the message parameter is not supportedUMOStreamMessageAdapter
String getName()
void setName(String newName)
newName
- the name to associate with the connectorString getProtocol()
boolean supportsProtocol(String protocol)
protocol
- protocol name
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 caughtScheduledExecutorService getScheduler()
void setDispatcherFactory(UMOMessageDispatcherFactory factory)
factory
- the factory to use when a dispatcher request is madrUMOMessageDispatcherFactory getDispatcherFactory()
void startConnector() throws UMOException
UMOException
void stopConnector() throws UMOException
UMOException
boolean isRemoteSyncEnabled()
void dispatch(UMOImmutableEndpoint endpoint, UMOEvent event) throws DispatchException
event
- The event to dispatchendpoint
- endpoint to dispatch from
DispatchException
- if the event fails to be dispatchedUMOMessage receive(UMOEndpointURI endpointUri, long timeout) throws Exception
endpointUri
- 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 exceptionUMOMessage receive(UMOImmutableEndpoint 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
returned
Exception
- if the call to the underlying protocal cuases an exceptionUMOMessage send(UMOImmutableEndpoint endpoint, UMOEvent event) throws DispatchException
event
- The event to sendendpoint
- endpoint to send from
DispatchException
- if the event fails to be dispatchedOutputStream getOutputStream(UMOImmutableEndpoint endpoint, UMOMessage message) throws UMOException
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 processed
UMOException
- in case of any error
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |