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.
Transport
s 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:
Modifier and Type | Method and Description |
---|---|
String |
getName() |
Object |
getOption(String name) |
Set<String> |
getOptionNames() |
String |
getOptionPrefix()
Specifies an option prefix made of string segments separated by the "."
|
String getName()
Bayeux.getAllowedTransports()
Object getOption(String name)
name
- the configuration option namequalifiedName
getOptionNames()
Set<String> getOptionNames()
getOption(String)
String getOptionPrefix()
Copyright © 2008–2024 The CometD Project. All rights reserved.