|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mortbay.component.AbstractLifeCycle org.cometd.oort.Oort
public class Oort
Oort cluster of cometd servers.
This class maintains a collection of OortComet
instances to each
comet server identified by calls to observeComet(String)
. The Oort
instance is created and configured by OortServlet
.
The key configuration parameter that must be set is the Oort URL, which is
full public URL to the cometd servlet, eg. http://myserver:8080/context/cometd
See OortServlet
for more configuration detail.
Nested Class Summary | |
---|---|
protected class |
Oort.OortExtension
Extension to detect incoming handshake from other Oort servers and to call oortHandshook(String, String, String) . |
protected class |
Oort.RemoteOortClientExtension
An Extension installed on clients for remote Oort servers that prevents publish loops. |
protected class |
Oort.RootOortClientListener
MessageListener that handles publishes to /oort/cloud |
Nested classes/interfaces inherited from interface org.mortbay.component.LifeCycle |
---|
LifeCycle.Listener |
Field Summary | |
---|---|
protected org.cometd.Bayeux |
_bayeux
|
protected Set<String> |
_channels
|
protected HttpClient |
_httpClient
|
protected Map<String,OortComet> |
_knownCommets
|
protected org.cometd.Client |
_oortClient
|
protected List<org.cometd.MessageListener> |
_oortMessageListeners
|
protected Random |
_random
|
protected String |
_secret
|
protected Timer |
_timer
|
protected String |
_url
|
static String |
OORT_ATTRIBUTE
|
static String |
OORT_CHANNELS
|
static String |
OORT_CLOUD
|
static String |
OORT_URL
|
Fields inherited from class org.mortbay.component.AbstractLifeCycle |
---|
_listeners |
Method Summary | |
---|---|
void |
addOortMessageListener(org.cometd.MessageListener listener)
Add a MessageListener that will receive all messages published on /oort/* channels on connected OortComets |
protected void |
doStart()
|
org.cometd.Bayeux |
getBayeux()
|
Set<String> |
getKnownComets()
|
String |
getSecret()
|
String |
getURL()
|
boolean |
isOort(org.cometd.Client client)
|
void |
observeChannel(String channelId)
Observer a channel. |
OortComet |
observeComet(String cometUrl)
Observe an Oort Comet server. |
protected void |
oortHandshook(String oortUrl,
String oortSecret,
String clientId)
Called to register the details of a successful handshake with an Oort comet. |
boolean |
removeOortClientListener(org.cometd.MessageListener listener)
Remove an Oort message listener. |
String |
toString()
|
Methods inherited from class org.mortbay.component.AbstractLifeCycle |
---|
addLifeCycleListener, doStop, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String OORT_URL
public static final String OORT_CLOUD
public static final String OORT_CHANNELS
public static final String OORT_ATTRIBUTE
protected String _url
protected String _secret
protected org.cometd.Bayeux _bayeux
protected HttpClient _httpClient
protected Timer _timer
protected Random _random
protected org.cometd.Client _oortClient
protected List<org.cometd.MessageListener> _oortMessageListeners
protected Map<String,OortComet> _knownCommets
protected Set<String> _channels
Method Detail |
---|
public org.cometd.Bayeux getBayeux()
public String getURL()
public String getSecret()
protected void doStart() throws Exception
doStart
in class AbstractLifeCycle
Exception
public OortComet observeComet(String cometUrl)
The the comet server is not already observed, start a OortComet
instance for it.
cometUrl
-
OortComet
instance for the comet server.public Set<String> getKnownComets()
public void observeChannel(String channelId)
Once observed, all OortComet
instances subscribe
to the channel and will repeat any messages published to
the local channel (with loop prevention), so that the
messages are distributed to all Oort comet servers.
channelId
- public void addOortMessageListener(org.cometd.MessageListener listener)
listener
- public boolean removeOortClientListener(org.cometd.MessageListener listener)
listener
-
public boolean isOort(org.cometd.Client client)
public String toString()
toString
in class Object
protected void oortHandshook(String oortUrl, String oortSecret, String clientId)
RemoteOortClientListener
instance is added to
the local Oort client instance.
oortUrl
- oortSecret
- clientId
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |