public interface Transport
Platform and created
internally by a ChannelFactory but it's possible to define custom
transport and register them| Modifier and Type | Method and Description |
|---|---|
void |
addStopListener(TransportStopListener listener)
Register a stop listener for this transport
|
java.lang.Object |
getContext()
The generic context object for this transport (actual type of the context depends on the
Platform) |
TransportStatusHandler |
getStatusHandler()
Get the status handler for this transport
|
boolean |
isDisconnectAfterAuthenticationFailure()
Indicates to the calling Channel that the transport should be closed after an authentication failure
|
boolean |
isReconnectAfterReceive()
Indicates to the calling Channel that the transport should reconnect when data has been received
|
boolean |
isStarted()
Is the transport started ?
|
boolean |
removeStopListener(TransportStopListener listener)
Unregister a stop listener for this transport
|
TransportFuture |
send(Channel channel,
TransportMessage message)
Send a message on the network
|
void |
setContext(java.lang.Object context)
Set the current context for this transport (usually depends on the
Platform) |
void |
setStatusHandler(TransportStatusHandler statusHandler)
Attach a status handler that will be notified of network activity and errors
|
boolean |
start()
Start the transport and enable transmission of data on the network
If there is an exception during start, the status handler is notified
TransportStatusHandler.handleException(org.granite.client.messaging.transport.TransportException) |
void |
stop()
Stop the transport and stop any communication on the network
|
void setContext(java.lang.Object context)
Platform)context - current contextjava.lang.Object getContext()
Platform)boolean start()
TransportStatusHandler.handleException(org.granite.client.messaging.transport.TransportException)boolean isStarted()
void stop()
boolean isReconnectAfterReceive()
boolean isDisconnectAfterAuthenticationFailure()
void setStatusHandler(TransportStatusHandler statusHandler)
statusHandler - status handlerTransportStatusHandlerTransportStatusHandler getStatusHandler()
TransportStatusHandlervoid addStopListener(TransportStopListener listener)
listener - stop listenerTransportStopListenerboolean removeStopListener(TransportStopListener listener)
listener - stop listenerTransportStopListenerTransportFuture send(Channel channel, TransportMessage message) throws TransportException
channel - originating channelmessage - message to sendTransportException - when an error occurs during send