Package org.mortbay.cometd.continuation
Class EXoContinuationBayeux
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.cometd.server.BayeuxServerImpl
org.mortbay.cometd.continuation.EXoContinuationBayeux
- All Implemented Interfaces:
org.cometd.bayeux.Bayeux,org.cometd.bayeux.server.BayeuxServer,org.eclipse.jetty.util.component.Container,org.eclipse.jetty.util.component.Destroyable,org.eclipse.jetty.util.component.Dumpable,org.eclipse.jetty.util.component.Dumpable.DumpableContainer,org.eclipse.jetty.util.component.LifeCycle,org.picocontainer.Disposable
public class EXoContinuationBayeux
extends org.cometd.server.BayeuxServerImpl
implements org.picocontainer.Disposable
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.cometd.bayeux.Bayeux
org.cometd.bayeux.Bayeux.BayeuxListener, org.cometd.bayeux.Bayeux.ValidatorNested classes/interfaces inherited from interface org.cometd.bayeux.server.BayeuxServer
org.cometd.bayeux.server.BayeuxServer.BayeuxServerListener, org.cometd.bayeux.server.BayeuxServer.ChannelListener, org.cometd.bayeux.server.BayeuxServer.Extension, org.cometd.bayeux.server.BayeuxServer.SessionListener, org.cometd.bayeux.server.BayeuxServer.SubscriptionListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener -
Field Summary
Fields inherited from class org.cometd.server.BayeuxServerImpl
ALLOWED_TRANSPORTS_OPTION, BROADCAST_TO_PUBLISHER_OPTION, EXECUTOR_MAX_THREADS, SCHEDULER_THREADS, SWEEP_PERIOD_OPTION, SWEEP_THREADS_OPTION, TRANSPORTS_OPTION, VALIDATE_MESSAGE_FIELDS_OPTIONFields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, STARTED, STARTING, STOPPED, STOPPINGFields inherited from interface org.cometd.bayeux.server.BayeuxServer
ATTRIBUTEFields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()getClientByEXoId(String eXoID) Deprecated.jakarta.servlet.ServletConfiglonggetUserToken(String eXoId) booleanbooleanbooleanisRelayed(org.cometd.bayeux.server.ServerSession sender) booleanisSubscribed(String eXoID, String clientID) org.cometd.bayeux.server.ServerSessionvoidobserveChannel(String channel) Relays to this node the messages published on the given channels on the other nodes of a cluster, as Oort does for the channels its configuration names.voidRuns an action with this node's Oort once it is set, at once when it is set already: a service that starts before the CometD servlet reaches the other nodes of a cluster so, such as to learn when one leaves.voidsendBroadcastMessage(String channel, Object data, String msgId) Publishes a message on a channel, even when no session of this node is subscribed to it: the subscribers of a pattern that matches the channel, such as the other nodes of a cluster that observe it, receive it too.voidsendMessage(String eXoID, String channel, Object data, String id) Send data to a individual client.voidsetCloudIDSeparator(String cloudIDSeparator) voidsetCometdContextName(String context) voidsetOort(org.cometd.oort.Oort oort) voidsetOortTrusted(boolean oortTrusted) voidsetServletConfig(jakarta.servlet.ServletConfig config) voidsetSeti(org.cometd.oort.Seti seti) voidsetTimeout(long timeout) Deprecated.Methods inherited from class org.cometd.server.BayeuxServerImpl
addExtension, addListener, addServerSession, addTransport, createChannelIfAbsent, createReply, doStart, doStop, dump, error, execute, extendOutgoing, extendReply, findHttpTransport, freeze, getAllowedTransports, getChannel, getChannels, getExecutor, getExtensions, getJSONContext, getKnownTransportNames, getLastSweepInfo, getListeners, getLongestSweepInfo, getName, getOption, getOption, getOption, getOptionNames, getOptions, getScheduler, getSecurityPolicy, getSession, getSessions, getSweepPeriod, getSweepThreads, getTransport, getTransports, handle, initializeJSONContext, initializeMetaChannels, initializeServerTransports, isBroadcastToPublisher, isDetailedDump, newChannelId, newLocalSession, newMessage, newMessage, newServerSession, publish, randomLong, removeExtension, removeListener, removeServerChannel, removeServerSession, removeSession, resolveLoop, schedule, setAllowedTransports, setAllowedTransports, setDetailedDump, setExecutor, setOption, setOptions, setScheduler, setSecurityPolicy, setSweepPeriod, setSweepThreads, setTransports, setTransports, sweep, unknownSession, validateMessageMethods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListenersMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dump, dumpSelfMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Constructor Details
-
EXoContinuationBayeux
public EXoContinuationBayeux()Default constructor.
-
-
Method Details
-
newRemoteClient
public org.cometd.bayeux.server.ServerSession newRemoteClient() -
setTimeout
Deprecated. -
getTimeout
public long getTimeout() -
getCometdContextName
- Returns:
- context name of cometd webapp
-
setCometdContextName
-
getUserToken
- Parameters:
eXoId- the client id.- Returns:
- token for client
-
getClientByEXoId
Deprecated.- Parameters:
eXoID- the id of client.- Returns:
- client with eXoID
-
isSubscribed
-
isPresent
- Parameters:
eXoID- the id of the target client- Returns:
- whether that client currently holds a CometD session.
falsewhen CometD is not initialized yet:setiis only assigned when the cometd servlet starts, so any caller reached before that — a listener firing during another addon's boot, for instance — must not blow up.
-
sendBroadcastMessage
Publishes a message on a channel, even when no session of this node is subscribed to it: the subscribers of a pattern that matches the channel, such as the other nodes of a cluster that observe it, receive it too.- Parameters:
channel- the id of channel.data- the messagemsgId- the message id
-
sendMessage
Send data to a individual client. The data passed is sent to the client as the "data" member of a message with the given channel and id. The message is not published on the channel and is thus not broadcast to all channel subscribers. However to the target client, the message appears as if it was broadcast.Typcially this method is only required if a service method sends response(s) to channels other than the subscribed channel. If the response is to be sent to the subscribed channel, then the data can simply be returned from the subscription method.
- Parameters:
eXoID- the id of target clientchannel- The id of channel the message is fordata- The data of the messageid- The id of the message (or null for a random id).
-
setSeti
public void setSeti(org.cometd.oort.Seti seti) -
setOort
public void setOort(org.cometd.oort.Oort oort) -
onOort
Runs an action with this node's Oort once it is set, at once when it is set already: a service that starts before the CometD servlet reaches the other nodes of a cluster so, such as to learn when one leaves.- Parameters:
action- the action, given this node's Oort
-
observeChannel
Relays to this node the messages published on the given channels on the other nodes of a cluster, as Oort does for the channels its configuration names. A channel a service publishes on with no session of this node's subscribed to it, such as a document's channel published on by the node that receives a third party's callback, reaches the users of the other nodes only so. May be called before Oort is set.- Parameters:
channel- a broadcast channel, or a pattern of them such as/a/b/**
-
isRelayed
public boolean isRelayed(org.cometd.bayeux.server.ServerSession sender) - Parameters:
sender- the session that published a message- Returns:
- true when the message was published on another node and relayed to this one by Oort: a handler acting on a client's message acts only on the node the client published it to, or it acts once per node of a cluster
-
setOortTrusted
public void setOortTrusted(boolean oortTrusted) - Parameters:
oortTrusted- whether handshakes and sessions of the other nodes of the cluster are accepted
-
isOortTrusted
public boolean isOortTrusted() -
setCloudIDSeparator
-
getServletConfig
public jakarta.servlet.ServletConfig getServletConfig() -
setServletConfig
public void setServletConfig(jakarta.servlet.ServletConfig config) -
dispose
public void dispose()- Specified by:
disposein interfaceorg.picocontainer.Disposable
-
getConnectedUserIds
- Returns:
- the users connected to this node and, in a cluster, to the other
nodes, as Seti knows them: a message sent to one of them with
sendMessage(String, String, Object, String)reaches the node the user is connected to
-