Package org.cometd.server
Class BayeuxServerImpl
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.cometd.server.BayeuxServerImpl
- All Implemented Interfaces:
org.cometd.bayeux.Bayeux,BayeuxServer,org.eclipse.jetty.util.component.Dumpable,org.eclipse.jetty.util.component.LifeCycle
@ManagedObject("The CometD server")
public class BayeuxServerImpl
extends org.eclipse.jetty.util.component.AbstractLifeCycle
implements BayeuxServer, org.eclipse.jetty.util.component.Dumpable
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListenerNested classes/interfaces inherited from interface org.cometd.bayeux.Bayeux
org.cometd.bayeux.Bayeux.BayeuxListenerNested classes/interfaces inherited from interface org.cometd.bayeux.server.BayeuxServer
BayeuxServer.BayeuxServerListener, BayeuxServer.ChannelListener, BayeuxServer.Extension, BayeuxServer.SessionListener, BayeuxServer.SubscriptionListener -
Field Summary
Fields Modifier and Type Field Description static StringALLOWED_TRANSPORTS_OPTIONstatic StringBROADCAST_TO_PUBLISHER_OPTIONstatic StringSWEEP_PERIOD_OPTIONstatic StringTRANSPORTS_OPTIONstatic StringVALIDATE_MESSAGE_FIELDS_OPTION -
Constructor Summary
Constructors Constructor Description BayeuxServerImpl() -
Method Summary
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop, toString
-
Field Details
-
ALLOWED_TRANSPORTS_OPTION
- See Also:
- Constant Field Values
-
SWEEP_PERIOD_OPTION
- See Also:
- Constant Field Values
-
TRANSPORTS_OPTION
- See Also:
- Constant Field Values
-
VALIDATE_MESSAGE_FIELDS_OPTION
- See Also:
- Constant Field Values
-
BROADCAST_TO_PUBLISHER_OPTION
- See Also:
- Constant Field Values
-
-
Constructor Details
-
BayeuxServerImpl
public BayeuxServerImpl()
-
-
Method Details
-
doStart
- Overrides:
doStartin classorg.eclipse.jetty.util.component.AbstractLifeCycle- Throws:
Exception
-
doStop
- Overrides:
doStopin classorg.eclipse.jetty.util.component.AbstractLifeCycle- Throws:
Exception
-
initializeMetaChannels
protected void initializeMetaChannels() -
initializeJSONContext
- Throws:
Exception
-
initializeServerTransports
protected void initializeServerTransports() -
schedule
Entry point to schedule tasks in CometD.
Subclasses may override and run the task in a
Executor, rather than in the scheduler thread.- Parameters:
task- the task to scheduledelay- the delay, in milliseconds, to run the task- Returns:
- the task promise
-
newChannelId
-
getOptions
-
getOption
@ManagedOperation(value="The value of the given configuration option", impact="INFO") public Object getOption(@Name("optionName") String qualifiedName)- Specified by:
getOptionin interfaceorg.cometd.bayeux.Bayeux
-
getOption
-
getOption
-
getOptionNames
- Specified by:
getOptionNamesin interfaceorg.cometd.bayeux.Bayeux
-
setOption
- Specified by:
setOptionin interfaceorg.cometd.bayeux.Bayeux
-
setOptions
-
randomLong
public long randomLong() -
getSecurityPolicy
- Specified by:
getSecurityPolicyin interfaceBayeuxServer
-
getJSONContext
-
createChannelIfAbsent
public org.cometd.bayeux.MarkedReference<ServerChannel> createChannelIfAbsent(String channelName, ConfigurableServerChannel.Initializer... initializers)- Specified by:
createChannelIfAbsentin interfaceBayeuxServer
-
getSessions
- Specified by:
getSessionsin interfaceBayeuxServer
-
removeSession
- Specified by:
removeSessionin interfaceBayeuxServer
-
getSession
- Specified by:
getSessionin interfaceBayeuxServer
-
addServerSession
-
removeServerSession
- Parameters:
session- the session to removetimedOut- whether the remove reason is server-side expiration- Returns:
- true if the session was removed and was connected
-
newServerSession
-
newLocalSession
- Specified by:
newLocalSessionin interfaceBayeuxServer
-
newMessage
- Specified by:
newMessagein interfaceBayeuxServer
-
newMessage
-
setSecurityPolicy
- Specified by:
setSecurityPolicyin interfaceBayeuxServer
-
addExtension
- Specified by:
addExtensionin interfaceBayeuxServer
-
removeExtension
- Specified by:
removeExtensionin interfaceBayeuxServer
-
getExtensions
- Specified by:
getExtensionsin interfaceBayeuxServer
-
addListener
- Specified by:
addListenerin interfaceBayeuxServer
-
getChannel
- Specified by:
getChannelin interfaceBayeuxServer
-
getChannels
- Specified by:
getChannelsin interfaceBayeuxServer
-
removeListener
- Specified by:
removeListenerin interfaceBayeuxServer
-
handle
public void handle(ServerSessionImpl session, ServerMessage.Mutable message, org.cometd.bayeux.Promise<ServerMessage.Mutable> promise) -
validateMessage
-
publish
protected void publish(ServerSessionImpl session, ServerChannelImpl channel, ServerMessage.Mutable message, boolean receiving, org.cometd.bayeux.Promise<Boolean> promise) -
resolveLoop
-
freeze
-
extendOutgoing
protected void extendOutgoing(ServerSession sender, ServerSession session, ServerMessage.Mutable message, org.cometd.bayeux.Promise<Boolean> promise) -
extendReply
public void extendReply(ServerSessionImpl sender, ServerSessionImpl session, ServerMessage.Mutable reply, org.cometd.bayeux.Promise<ServerMessage.Mutable> promise) -
removeServerChannel
-
getListeners
-
getKnownTransportNames
- Specified by:
getKnownTransportNamesin interfaceorg.cometd.bayeux.Bayeux
-
getTransport
- Specified by:
getTransportin interfaceorg.cometd.bayeux.Bayeux
-
addTransport
-
setTransports
-
setTransports
-
getTransports
-
findHttpTransport
-
getAllowedTransports
@ManagedAttribute(value="The transports allowed by this server", readonly=true) public List<String> getAllowedTransports()- Specified by:
getAllowedTransportsin interfaceorg.cometd.bayeux.Bayeux
-
setAllowedTransports
-
setAllowedTransports
-
isBroadcastToPublisher
@ManagedAttribute(value="Whether this server broadcast messages to the publisher", readonly=true) public boolean isBroadcastToPublisher() -
unknownSession
-
error
-
createReply
-
sweep
@ManagedOperation(value="Sweeps channels and sessions of this BayeuxServer", impact="ACTION") public void sweep() -
isDetailedDump
@ManagedAttribute("Reports additional details in the dump") public boolean isDetailedDump() -
setDetailedDump
public void setDetailedDump(boolean detailedDump) -
dump
- Specified by:
dumpin interfaceorg.eclipse.jetty.util.component.Dumpable- Throws:
IOException
-