org.cometd.bayeux.Bayeux, org.cometd.bayeux.server.BayeuxServer, org.eclipse.jetty.util.component.Dumpable@ManagedObject("The CometD server")
public class BayeuxServerImpl
extends org.eclipse.jetty.util.component.AbstractLifeCycle
implements org.cometd.bayeux.server.BayeuxServer, org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListenerorg.cometd.bayeux.Bayeux.BayeuxListenerorg.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.SubscriptionListener| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
ALLOWED_TRANSPORTS_OPTION |
|
static java.lang.String |
BROADCAST_TO_PUBLISHER_OPTION |
|
static java.lang.String |
SWEEP_PERIOD_OPTION |
|
static java.lang.String |
TRANSPORTS_OPTION |
|
static java.lang.String |
VALIDATE_MESSAGE_FIELDS_OPTION |
| Constructor | Description |
|---|---|
BayeuxServerImpl() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addExtension(org.cometd.bayeux.server.BayeuxServer.Extension extension) |
|
void |
addListener(org.cometd.bayeux.server.BayeuxServer.BayeuxServerListener listener) |
|
protected void |
addServerSession(ServerSessionImpl session,
org.cometd.bayeux.server.ServerMessage message) |
|
org.cometd.bayeux.server.ServerTransport |
addTransport(org.cometd.bayeux.server.ServerTransport transport) |
|
org.cometd.bayeux.MarkedReference<org.cometd.bayeux.server.ServerChannel> |
createChannelIfAbsent(java.lang.String channelName,
org.cometd.bayeux.server.ConfigurableServerChannel.Initializer... initializers) |
|
protected org.cometd.bayeux.server.ServerMessage.Mutable |
createReply(org.cometd.bayeux.server.ServerMessage.Mutable message) |
|
protected void |
doStart() |
|
protected void |
doStop() |
|
java.lang.String |
dump() |
|
void |
dump(java.lang.Appendable out,
java.lang.String indent) |
|
protected void |
error(org.cometd.bayeux.server.ServerMessage.Mutable reply,
java.lang.String error) |
|
protected void |
extendOutgoing(org.cometd.bayeux.server.ServerSession sender,
org.cometd.bayeux.server.ServerSession session,
org.cometd.bayeux.server.ServerMessage.Mutable message,
org.cometd.bayeux.Promise<java.lang.Boolean> promise) |
|
void |
extendReply(ServerSessionImpl sender,
ServerSessionImpl session,
org.cometd.bayeux.server.ServerMessage.Mutable reply,
org.cometd.bayeux.Promise<org.cometd.bayeux.server.ServerMessage.Mutable> promise) |
|
protected AbstractHttpTransport |
findHttpTransport(javax.servlet.http.HttpServletRequest request) |
|
void |
freeze(org.cometd.bayeux.server.ServerMessage.Mutable mutable) |
|
java.util.List<java.lang.String> |
getAllowedTransports() |
|
org.cometd.bayeux.server.ServerChannel |
getChannel(java.lang.String channelId) |
|
java.util.List<org.cometd.bayeux.server.ServerChannel> |
getChannels() |
|
org.cometd.bayeux.server.BayeuxContext |
getContext() |
|
org.cometd.bayeux.server.ServerTransport |
getCurrentTransport() |
|
java.util.List<org.cometd.bayeux.server.BayeuxServer.Extension> |
getExtensions() |
|
JSONContext.Server |
getJSONContext() |
|
java.util.Set<java.lang.String> |
getKnownTransportNames() |
|
protected java.util.List<org.cometd.bayeux.server.BayeuxServer.BayeuxServerListener> |
getListeners() |
|
java.lang.Object |
getOption(java.lang.String qualifiedName) |
|
protected boolean |
getOption(java.lang.String name,
boolean dft) |
|
protected long |
getOption(java.lang.String name,
long dft) |
|
java.util.Set<java.lang.String> |
getOptionNames() |
|
java.util.Map<java.lang.String,java.lang.Object> |
getOptions() |
|
org.cometd.bayeux.server.SecurityPolicy |
getSecurityPolicy() |
|
org.cometd.bayeux.server.ServerSession |
getSession(java.lang.String clientId) |
|
java.util.List<org.cometd.bayeux.server.ServerSession> |
getSessions() |
|
org.cometd.bayeux.server.ServerTransport |
getTransport(java.lang.String transport) |
|
java.util.List<org.cometd.bayeux.server.ServerTransport> |
getTransports() |
|
void |
handle(ServerSessionImpl session,
org.cometd.bayeux.server.ServerMessage.Mutable message,
org.cometd.bayeux.Promise<org.cometd.bayeux.server.ServerMessage.Mutable> promise) |
|
protected void |
initializeJSONContext() |
|
protected void |
initializeMetaChannels() |
|
protected void |
initializeServerTransports() |
|
boolean |
isBroadcastToPublisher() |
|
boolean |
isDetailedDump() |
|
org.cometd.bayeux.ChannelId |
newChannelId(java.lang.String id) |
|
org.cometd.bayeux.server.LocalSession |
newLocalSession(java.lang.String idHint) |
|
org.cometd.bayeux.server.ServerMessage.Mutable |
newMessage() |
|
org.cometd.bayeux.server.ServerMessage.Mutable |
newMessage(org.cometd.bayeux.server.ServerMessage tocopy) |
|
ServerSessionImpl |
newServerSession() |
|
protected void |
publish(ServerSessionImpl session,
ServerChannelImpl channel,
org.cometd.bayeux.server.ServerMessage.Mutable message,
boolean receiving,
org.cometd.bayeux.Promise<java.lang.Boolean> promise) |
|
long |
randomLong() |
|
void |
removeExtension(org.cometd.bayeux.server.BayeuxServer.Extension extension) |
|
void |
removeListener(org.cometd.bayeux.server.BayeuxServer.BayeuxServerListener listener) |
|
protected boolean |
removeServerChannel(ServerChannelImpl channel) |
|
boolean |
removeServerSession(org.cometd.bayeux.server.ServerSession session,
boolean timedOut) |
|
boolean |
removeSession(org.cometd.bayeux.server.ServerSession session) |
|
protected org.cometd.bayeux.Promise<java.lang.Boolean> |
resolveLoop(AsyncFoldLeft.Loop<java.lang.Boolean> loop) |
|
org.eclipse.jetty.util.thread.Scheduler.Task |
schedule(java.lang.Runnable task,
long delay) |
Entry point to schedule tasks in CometD.
|
void |
setAllowedTransports(java.lang.String... allowed) |
|
void |
setAllowedTransports(java.util.List<java.lang.String> allowed) |
|
void |
setCurrentTransport(org.cometd.bayeux.server.ServerTransport transport) |
|
void |
setDetailedDump(boolean detailedDump) |
|
void |
setOption(java.lang.String qualifiedName,
java.lang.Object value) |
|
void |
setOptions(java.util.Map<java.lang.String,java.lang.Object> options) |
|
void |
setSecurityPolicy(org.cometd.bayeux.server.SecurityPolicy securityPolicy) |
|
void |
setTransports(java.util.List<org.cometd.bayeux.server.ServerTransport> transports) |
|
void |
setTransports(org.cometd.bayeux.server.ServerTransport... transports) |
|
void |
sweep() |
|
protected void |
unknownSession(org.cometd.bayeux.server.ServerMessage.Mutable reply) |
|
protected java.lang.String |
validateMessage(org.cometd.bayeux.server.ServerMessage.Mutable message) |
public static final java.lang.String ALLOWED_TRANSPORTS_OPTION
public static final java.lang.String SWEEP_PERIOD_OPTION
public static final java.lang.String TRANSPORTS_OPTION
public static final java.lang.String VALIDATE_MESSAGE_FIELDS_OPTION
public static final java.lang.String BROADCAST_TO_PUBLISHER_OPTION
protected void doStart()
throws java.lang.Exception
doStart in class org.eclipse.jetty.util.component.AbstractLifeCyclejava.lang.Exceptionprotected void doStop()
throws java.lang.Exception
doStop in class org.eclipse.jetty.util.component.AbstractLifeCyclejava.lang.Exceptionprotected void initializeMetaChannels()
protected void initializeJSONContext()
throws java.lang.Exception
java.lang.Exceptionprotected void initializeServerTransports()
public org.eclipse.jetty.util.thread.Scheduler.Task schedule(java.lang.Runnable task,
long delay)
Entry point to schedule tasks in CometD.
Subclasses may override and run the task in a Executor,
rather than in the scheduler thread.
task - the task to scheduledelay - the delay, in milliseconds, to run the taskpublic org.cometd.bayeux.ChannelId newChannelId(java.lang.String id)
public java.util.Map<java.lang.String,java.lang.Object> getOptions()
@ManagedOperation(value="The value of the given configuration option",
impact="INFO")
public java.lang.Object getOption(@Name("optionName")
java.lang.String qualifiedName)
getOption in interface org.cometd.bayeux.Bayeuxprotected long getOption(java.lang.String name,
long dft)
protected boolean getOption(java.lang.String name,
boolean dft)
public java.util.Set<java.lang.String> getOptionNames()
getOptionNames in interface org.cometd.bayeux.Bayeuxpublic void setOption(java.lang.String qualifiedName,
java.lang.Object value)
setOption in interface org.cometd.bayeux.Bayeuxpublic void setOptions(java.util.Map<java.lang.String,java.lang.Object> options)
public long randomLong()
public void setCurrentTransport(org.cometd.bayeux.server.ServerTransport transport)
public org.cometd.bayeux.server.ServerTransport getCurrentTransport()
getCurrentTransport in interface org.cometd.bayeux.server.BayeuxServerpublic org.cometd.bayeux.server.BayeuxContext getContext()
getContext in interface org.cometd.bayeux.server.BayeuxServerpublic org.cometd.bayeux.server.SecurityPolicy getSecurityPolicy()
getSecurityPolicy in interface org.cometd.bayeux.server.BayeuxServerpublic JSONContext.Server getJSONContext()
public org.cometd.bayeux.MarkedReference<org.cometd.bayeux.server.ServerChannel> createChannelIfAbsent(java.lang.String channelName,
org.cometd.bayeux.server.ConfigurableServerChannel.Initializer... initializers)
createChannelIfAbsent in interface org.cometd.bayeux.server.BayeuxServerpublic java.util.List<org.cometd.bayeux.server.ServerSession> getSessions()
getSessions in interface org.cometd.bayeux.server.BayeuxServerpublic boolean removeSession(org.cometd.bayeux.server.ServerSession session)
removeSession in interface org.cometd.bayeux.server.BayeuxServerpublic org.cometd.bayeux.server.ServerSession getSession(java.lang.String clientId)
getSession in interface org.cometd.bayeux.server.BayeuxServerprotected void addServerSession(ServerSessionImpl session, org.cometd.bayeux.server.ServerMessage message)
public boolean removeServerSession(org.cometd.bayeux.server.ServerSession session,
boolean timedOut)
session - the session to removetimedOut - whether the remove reason is server-side expirationpublic ServerSessionImpl newServerSession()
public org.cometd.bayeux.server.LocalSession newLocalSession(java.lang.String idHint)
newLocalSession in interface org.cometd.bayeux.server.BayeuxServerpublic org.cometd.bayeux.server.ServerMessage.Mutable newMessage()
newMessage in interface org.cometd.bayeux.server.BayeuxServerpublic org.cometd.bayeux.server.ServerMessage.Mutable newMessage(org.cometd.bayeux.server.ServerMessage tocopy)
public void setSecurityPolicy(org.cometd.bayeux.server.SecurityPolicy securityPolicy)
setSecurityPolicy in interface org.cometd.bayeux.server.BayeuxServerpublic void addExtension(org.cometd.bayeux.server.BayeuxServer.Extension extension)
addExtension in interface org.cometd.bayeux.server.BayeuxServerpublic void removeExtension(org.cometd.bayeux.server.BayeuxServer.Extension extension)
removeExtension in interface org.cometd.bayeux.server.BayeuxServerpublic java.util.List<org.cometd.bayeux.server.BayeuxServer.Extension> getExtensions()
getExtensions in interface org.cometd.bayeux.server.BayeuxServerpublic void addListener(org.cometd.bayeux.server.BayeuxServer.BayeuxServerListener listener)
addListener in interface org.cometd.bayeux.server.BayeuxServerpublic org.cometd.bayeux.server.ServerChannel getChannel(java.lang.String channelId)
getChannel in interface org.cometd.bayeux.server.BayeuxServerpublic java.util.List<org.cometd.bayeux.server.ServerChannel> getChannels()
getChannels in interface org.cometd.bayeux.server.BayeuxServerpublic void removeListener(org.cometd.bayeux.server.BayeuxServer.BayeuxServerListener listener)
removeListener in interface org.cometd.bayeux.server.BayeuxServerpublic void handle(ServerSessionImpl session, org.cometd.bayeux.server.ServerMessage.Mutable message, org.cometd.bayeux.Promise<org.cometd.bayeux.server.ServerMessage.Mutable> promise)
protected java.lang.String validateMessage(org.cometd.bayeux.server.ServerMessage.Mutable message)
protected void publish(ServerSessionImpl session, ServerChannelImpl channel, org.cometd.bayeux.server.ServerMessage.Mutable message, boolean receiving, org.cometd.bayeux.Promise<java.lang.Boolean> promise)
protected org.cometd.bayeux.Promise<java.lang.Boolean> resolveLoop(AsyncFoldLeft.Loop<java.lang.Boolean> loop)
public void freeze(org.cometd.bayeux.server.ServerMessage.Mutable mutable)
protected void extendOutgoing(org.cometd.bayeux.server.ServerSession sender,
org.cometd.bayeux.server.ServerSession session,
org.cometd.bayeux.server.ServerMessage.Mutable message,
org.cometd.bayeux.Promise<java.lang.Boolean> promise)
public void extendReply(ServerSessionImpl sender, ServerSessionImpl session, org.cometd.bayeux.server.ServerMessage.Mutable reply, org.cometd.bayeux.Promise<org.cometd.bayeux.server.ServerMessage.Mutable> promise)
protected boolean removeServerChannel(ServerChannelImpl channel)
protected java.util.List<org.cometd.bayeux.server.BayeuxServer.BayeuxServerListener> getListeners()
public java.util.Set<java.lang.String> getKnownTransportNames()
getKnownTransportNames in interface org.cometd.bayeux.Bayeuxpublic org.cometd.bayeux.server.ServerTransport getTransport(java.lang.String transport)
getTransport in interface org.cometd.bayeux.Bayeuxpublic org.cometd.bayeux.server.ServerTransport addTransport(org.cometd.bayeux.server.ServerTransport transport)
public void setTransports(org.cometd.bayeux.server.ServerTransport... transports)
public void setTransports(java.util.List<org.cometd.bayeux.server.ServerTransport> transports)
public java.util.List<org.cometd.bayeux.server.ServerTransport> getTransports()
protected AbstractHttpTransport findHttpTransport(javax.servlet.http.HttpServletRequest request)
@ManagedAttribute(value="The transports allowed by this server",
readonly=true)
public java.util.List<java.lang.String> getAllowedTransports()
getAllowedTransports in interface org.cometd.bayeux.Bayeuxpublic void setAllowedTransports(java.lang.String... allowed)
public void setAllowedTransports(java.util.List<java.lang.String> allowed)
@ManagedAttribute(value="Whether this server broadcast messages to the publisher",
readonly=true)
public boolean isBroadcastToPublisher()
protected void unknownSession(org.cometd.bayeux.server.ServerMessage.Mutable reply)
protected void error(org.cometd.bayeux.server.ServerMessage.Mutable reply,
java.lang.String error)
protected org.cometd.bayeux.server.ServerMessage.Mutable createReply(org.cometd.bayeux.server.ServerMessage.Mutable message)
@ManagedOperation(value="Sweeps channels and sessions of this BayeuxServer",
impact="ACTION")
public void sweep()
@ManagedAttribute("Reports additional details in the dump")
public boolean isDetailedDump()
public void setDetailedDump(boolean detailedDump)
@ManagedOperation(value="Dumps the BayeuxServer state",
impact="INFO")
public java.lang.String dump()
dump in interface org.eclipse.jetty.util.component.Dumpablepublic void dump(java.lang.Appendable out,
java.lang.String indent)
throws java.io.IOException
dump in interface org.eclipse.jetty.util.component.Dumpablejava.io.IOExceptionCopyright © 2008–2017 The CometD Project. All rights reserved.