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.AbstractLifeCycleListener
Nested classes/interfaces inherited from interface org.cometd.bayeux.Bayeux
org.cometd.bayeux.Bayeux.BayeuxListener
Nested 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 String
ALLOWED_TRANSPORTS_OPTION
static String
BROADCAST_TO_PUBLISHER_OPTION
static String
SWEEP_PERIOD_OPTION
static String
TRANSPORTS_OPTION
static String
VALIDATE_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:
doStart
in classorg.eclipse.jetty.util.component.AbstractLifeCycle
- Throws:
Exception
-
doStop
- Overrides:
doStop
in 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:
getOption
in interfaceorg.cometd.bayeux.Bayeux
-
getOption
-
getOption
-
getOptionNames
- Specified by:
getOptionNames
in interfaceorg.cometd.bayeux.Bayeux
-
setOption
- Specified by:
setOption
in interfaceorg.cometd.bayeux.Bayeux
-
setOptions
-
randomLong
public long randomLong() -
getSecurityPolicy
- Specified by:
getSecurityPolicy
in interfaceBayeuxServer
-
getJSONContext
-
createChannelIfAbsent
public org.cometd.bayeux.MarkedReference<ServerChannel> createChannelIfAbsent(String channelName, ConfigurableServerChannel.Initializer... initializers)- Specified by:
createChannelIfAbsent
in interfaceBayeuxServer
-
getSessions
- Specified by:
getSessions
in interfaceBayeuxServer
-
removeSession
- Specified by:
removeSession
in interfaceBayeuxServer
-
getSession
- Specified by:
getSession
in 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:
newLocalSession
in interfaceBayeuxServer
-
newMessage
- Specified by:
newMessage
in interfaceBayeuxServer
-
newMessage
-
setSecurityPolicy
- Specified by:
setSecurityPolicy
in interfaceBayeuxServer
-
addExtension
- Specified by:
addExtension
in interfaceBayeuxServer
-
removeExtension
- Specified by:
removeExtension
in interfaceBayeuxServer
-
getExtensions
- Specified by:
getExtensions
in interfaceBayeuxServer
-
addListener
- Specified by:
addListener
in interfaceBayeuxServer
-
getChannel
- Specified by:
getChannel
in interfaceBayeuxServer
-
getChannels
- Specified by:
getChannels
in interfaceBayeuxServer
-
removeListener
- Specified by:
removeListener
in 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:
getKnownTransportNames
in interfaceorg.cometd.bayeux.Bayeux
-
getTransport
- Specified by:
getTransport
in 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:
getAllowedTransports
in 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:
dump
in interfaceorg.eclipse.jetty.util.component.Dumpable
- Throws:
IOException
-