|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 |
public static final int INT_VALUE_NOT_SET
Method Detail |
public 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 registeredpublic void 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
exceptionpublic boolean isStarted()
public boolean isDisposed()
public boolean isDisposing()
public 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
public 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
public String getName()
public void setName(String newName)
newName
- the name to associate with the connectorpublic String getProtocol()
public boolean supportsProtocol(String protocol)
protocol
- protocol name
public void setExceptionListener(ExceptionListener listener)
listener
- the exception strategy to use with this endpointExceptionListener
public ExceptionListener getExceptionListener()
ExceptionListener
public void handleException(Exception exception)
exception
- the exception that was caughtpublic ScheduledExecutorService getScheduler()
public void setDispatcherFactory(UMOMessageDispatcherFactory factory)
factory
- the factory to use when a dispatcher request is madrpublic UMOMessageDispatcherFactory getDispatcherFactory()
public void startConnector() throws UMOException
UMOException
public void stopConnector() throws UMOException
UMOException
public boolean isRemoteSyncEnabled()
public void dispatch(UMOImmutableEndpoint endpoint, UMOEvent event) throws DispatchException
event
- The event to dispatchendpoint
- endpoint to dispatch from
DispatchException
- if the event fails to be dispatchedpublic UMOMessage 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 exceptionpublic UMOMessage 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 exceptionpublic UMOMessage send(UMOImmutableEndpoint endpoint, UMOEvent event) throws DispatchException
event
- The event to sendendpoint
- endpoint to send from
DispatchException
- if the event fails to be dispatchedpublic OutputStream 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 |