|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.cometd.common.AbstractTransport
public class AbstractTransport
| Constructor Summary | |
|---|---|
protected |
AbstractTransport(String name,
Map<String,Object> options)
|
| Method Summary | |
|---|---|
String |
getName()
|
Object |
getOption(String name)
Get an option value. |
boolean |
getOption(String option,
boolean dftValue)
Get option or default value. |
int |
getOption(String option,
int dftValue)
Get option or default value. |
long |
getOption(String option,
long dftValue)
Get option or default value. |
String |
getOption(String option,
String dftValue)
Get option or default value. |
Set<String> |
getOptionNames()
|
String |
getOptionPrefix()
|
void |
setOption(String name,
Object value)
|
void |
setOptionPrefix(String prefix)
Set the option name prefix segment. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractTransport(String name,
Map<String,Object> options)
| Method Detail |
|---|
public String getName()
getName in interface Transportpublic Object getOption(String name)
BayeuxServerImpl#getOptions() is
searched for the option name with the most specific prefix.
If this transport was initialised with calls:
addPrefix("long-polling");
addPrefix("jsonp");
then a call to getOption("foobar") will look for the
most specific value with names:long-polling.json.foobar long-polling.foobar foobar
getOption in interface Transport
public void setOption(String name,
Object value)
name - value - public String getOptionPrefix()
getOptionPrefix in interface Transportpublic void setOptionPrefix(String prefix)
Normally this is called by the super class constructors to establish
a naming hierarchy for options and iteracts with the setOption(String, Object)
method to create a naming hierarchy for options.
For example the following sequence of calls:
setOption("foo","x");
setOption("bar","y");
setOptionPrefix("long-polling");
setOption("foo","z");
setOption("whiz","p");
setOptionPrefix("long-polling.jsonp");
setOption("bang","q");
setOption("bar","r");
will establish the following option names and values:foo: x bar: y long-polling.foo: z long-polling.whiz: p long-polling.jsonp.bang: q long-polling.jsonp.bar: rThe various
getOption(String) methods will search this
name tree for the most specific match.
segment - name
IllegalArgumentException - if the new prefix is not prefixed by the old prefix.public Set<String> getOptionNames()
getOptionNames in interface TransportgetOptionNames()
public String getOption(String option,
String dftValue)
option - The option name.dftValue - The default value.
getOption(String)
public long getOption(String option,
long dftValue)
option - The option name.dftValue - The default value.
getOption(String)
public int getOption(String option,
int dftValue)
option - The option name.dftValue - The default value.
getOption(String)
public boolean getOption(String option,
boolean dftValue)
option - The option name.dftValue - The default value.
getOption(String)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||