org.cometd.bayeux
Interface Transport

All Known Subinterfaces:
ServerTransport

public interface Transport

A transport abstract the details of the protocol used to send Bayeux messages over the network, for example using HTTP or using WebSocket.

Transports have well known names and both a Bayeux client and a Bayeux server can negotiate the transport they want to use by exchanging the list of supported transport names.

Transports can be configured using options. The transport implementation provides a set of option names that it uses to configure itself and an option prefix that allows specific tuning of the configuration.
Option prefixes may be composed of segments separated by the "." character.

For example, imagine to configure the transports for normal long polling, for JSONP long polling and for WebSocket. All provide a common option name called "timeout" and the JSONP long polling transport provides also a specific option name called "callback".
The normal long polling transport has prefix "long-polling.json", the JSONP long polling transport has prefix "long-polling.jsonp" and the WebSocket long polling transport has prefix "ws". The first two prefixes have 2 segments.

The configurator will asks the transports the set of option names, obtaining ["timeout", "callback"]; then will ask each transport its prefix, obtaining ["long-polling.json", "long-polling.jsonp"].
The configurator can now look in the configuration (for example a properties file or servlet init parameters) for entries that combine the option names and option prefix segments, such as:

Version:
$Revision: 1483 $ $Date: 2009-03-04 14:56:47 +0100 (Wed, 04 Mar 2009) $

Method Summary
 String getName()
           
 Object getOption(String name)
           
 Set<String> getOptionNames()
           
 String getOptionPrefix()
          Specifies an option prefix made of string segments separated by the "." character, used to override more generic configuration entries.
 

Method Detail

getName

String getName()
Returns:
The well known name of this transport, used in transport negotiations
See Also:
Bayeux.getAllowedTransports()

getOption

Object getOption(String name)
Parameters:
name - the configuration option name
Returns:
the configuration option with the given qualifiedName
See Also:
getOptionNames()

getOptionNames

Set<String> getOptionNames()
Returns:
the set of configuration options
See Also:
getOption(String)

getOptionPrefix

String getOptionPrefix()
Specifies an option prefix made of string segments separated by the "." character, used to override more generic configuration entries.

Returns:
the option prefix for this transport.


Copyright © 2008-2010 Dojo Foundation. All Rights Reserved.