Errai 3.0.1-SNAPSHOT

org.jboss.errai.bus.client.framework.transports
Interface TransportHandler

All Known Implementing Classes:
HttpPollingHandler, SSEHandler, WebsocketHandler

public interface TransportHandler

Author:
Mike Brock

Field Summary
static String EXTRA_URI_PARMS_RESOURCE
           
static String UNSUPPORTED_MESSAGE_NO_CLIENT_SUPPORT
           
static String UNSUPPORTED_MESSAGE_NO_SERVER_SUPPORT
           
 
Method Summary
 void close()
          Permanently closes this transport handler.
 void configure(Message capabilitiesMessage)
          Called to configure the transport.
 TransportStatistics getStatistics()
          Returns the TransportStatistics instance.
 void handleProtocolExtension(Message message)
          Allows extension to the standard ErraiBus Protocol by optionally handling any unknown protocol verbs from the wire.
 boolean isUsable()
          Indicates whether the transport is usable.
 void start()
          Called to start the transport.
 Collection<Message> stop(boolean stopAllCurrentRequests)
          Called to stop the transport.
 void transmit(List<Message> txMessages)
          Transmits the specified list of Message to the remote bus over the transport.
 

Field Detail

EXTRA_URI_PARMS_RESOURCE

static final String EXTRA_URI_PARMS_RESOURCE
See Also:
Constant Field Values

UNSUPPORTED_MESSAGE_NO_SERVER_SUPPORT

static final String UNSUPPORTED_MESSAGE_NO_SERVER_SUPPORT
See Also:
Constant Field Values

UNSUPPORTED_MESSAGE_NO_CLIENT_SUPPORT

static final String UNSUPPORTED_MESSAGE_NO_CLIENT_SUPPORT
See Also:
Constant Field Values
Method Detail

configure

void configure(Message capabilitiesMessage)
Called to configure the transport. The Message instance passed to the handler, is the initial response message from the server during the ErraiBus protocol handshake, which contains the capabilities data for the remote bus.

Parameters:
capabilitiesMessage - the capabilities message from the message bus on handshake.

start

void start()
Called to start the transport.


stop

Collection<Message> stop(boolean stopAllCurrentRequests)
Called to stop the transport.

Parameters:
stopAllCurrentRequests - specifying true will cause any in-flight messages which have not returned to be immediately cancelled.
Returns:
a list of messages which were not delivered before the transport was stopped.

transmit

void transmit(List<Message> txMessages)
Transmits the specified list of Message to the remote bus over the transport.

Parameters:
txMessages - a list of Message to be transmitted.

handleProtocolExtension

void handleProtocolExtension(Message message)
Allows extension to the standard ErraiBus Protocol by optionally handling any unknown protocol verbs from the wire.

Parameters:
message -

isUsable

boolean isUsable()
Indicates whether the transport is usable. This method is called during transport switching by the bus to determine which transport to use. The first usable transport is chosen and started.

Returns:
true if the handler is usable.

getStatistics

TransportStatistics getStatistics()
Returns the TransportStatistics instance.

Returns:

close

void close()
Permanently closes this transport handler. Once closed, a TransportHandler cannot be used again. It is imperative that a TransportHandler is closed when it is no longer needed; failing to do so may leak resources and lead to client bus malfunctions.


Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.