@ManagedObject(value="The CometD server") public class BayeuxServerImpl extends org.eclipse.jetty.util.component.AbstractLifeCycle implements BayeuxServer, org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListenerBayeuxServer.BayeuxServerListener, BayeuxServer.ChannelListener, BayeuxServer.Extension, BayeuxServer.SessionListener, BayeuxServer.SubscriptionListenerBayeux.BayeuxListener| Modifier and Type | Field and 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 |
FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPINGATTRIBUTE| Constructor and Description |
|---|
BayeuxServerImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addExtension(BayeuxServer.Extension extension) |
void |
addListener(BayeuxServer.BayeuxServerListener listener) |
protected void |
addServerSession(ServerSessionImpl session,
ServerMessage message) |
ServerTransport |
addTransport(ServerTransport transport) |
MarkedReference<ServerChannel> |
createChannelIfAbsent(java.lang.String channelName,
ConfigurableServerChannel.Initializer... initializers) |
protected ServerMessage.Mutable |
createReply(ServerMessage.Mutable message) |
protected void |
doPublish(ServerSessionImpl from,
ServerChannelImpl to,
ServerMessage.Mutable mutable,
boolean receiving) |
protected void |
doStart() |
protected void |
doStop() |
java.lang.String |
dump() |
void |
dump(java.lang.Appendable out,
java.lang.String indent) |
protected void |
error(ServerMessage.Mutable reply,
java.lang.String error) |
protected boolean |
extendRecv(ServerSession from,
ServerMessage.Mutable message) |
ServerMessage.Mutable |
extendReply(ServerSessionImpl from,
ServerSessionImpl to,
ServerMessage.Mutable reply) |
protected boolean |
extendSend(ServerSession from,
ServerSession to,
ServerMessage.Mutable message) |
protected AbstractHttpTransport |
findHttpTransport(javax.servlet.http.HttpServletRequest request) |
void |
freeze(ServerMessage.Mutable mutable) |
java.util.List<java.lang.String> |
getAllowedTransports() |
ServerChannel |
getChannel(java.lang.String channelId) |
java.util.List<ServerChannel> |
getChannels() |
BayeuxContext |
getContext() |
ServerTransport |
getCurrentTransport() |
java.util.List<BayeuxServer.Extension> |
getExtensions() |
JSONContext.Server |
getJSONContext() |
java.util.Set<java.lang.String> |
getKnownTransportNames() |
protected java.util.List<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() |
SecurityPolicy |
getSecurityPolicy() |
ServerSession |
getSession(java.lang.String clientId) |
java.util.List<ServerSession> |
getSessions() |
ServerTransport |
getTransport(java.lang.String transport) |
java.util.List<ServerTransport> |
getTransports() |
ServerMessage.Mutable |
handle(ServerSessionImpl session,
ServerMessage.Mutable message) |
protected void |
initializeJSONContext() |
protected void |
initializeMetaChannels() |
protected void |
initializeServerTransports() |
boolean |
isBroadcastToPublisher() |
boolean |
isDetailedDump() |
ChannelId |
newChannelId(java.lang.String id) |
LocalSession |
newLocalSession(java.lang.String idHint) |
ServerMessage.Mutable |
newMessage() |
ServerMessage.Mutable |
newMessage(ServerMessage tocopy) |
ServerSessionImpl |
newServerSession() |
long |
randomLong() |
void |
removeExtension(BayeuxServer.Extension extension) |
void |
removeListener(BayeuxServer.BayeuxServerListener listener) |
protected boolean |
removeServerChannel(ServerChannelImpl channel) |
boolean |
removeServerSession(ServerSession session,
boolean timedOut) |
boolean |
removeSession(ServerSession session) |
org.eclipse.jetty.util.thread.Scheduler.Task |
schedule(java.lang.Runnable task,
long delay)
Entry point to schedule tasks in CometD.
|
void |
setAllowedTransports(java.util.List<java.lang.String> allowed) |
void |
setAllowedTransports(java.lang.String... allowed) |
void |
setCurrentTransport(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(SecurityPolicy securityPolicy) |
void |
setTransports(java.util.List<ServerTransport> transports) |
void |
setTransports(ServerTransport... transports) |
void |
sweep() |
protected void |
unknownSession(ServerMessage.Mutable reply) |
protected void |
validateMessage(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 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(value="optionName")
java.lang.String qualifiedName)
protected 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 Bayeuxpublic void setOption(java.lang.String qualifiedName,
java.lang.Object value)
public void setOptions(java.util.Map<java.lang.String,java.lang.Object> options)
public long randomLong()
public void setCurrentTransport(ServerTransport transport)
public ServerTransport getCurrentTransport()
getCurrentTransport in interface BayeuxServerpublic BayeuxContext getContext()
getContext in interface BayeuxServerpublic SecurityPolicy getSecurityPolicy()
getSecurityPolicy in interface BayeuxServerpublic JSONContext.Server getJSONContext()
public MarkedReference<ServerChannel> createChannelIfAbsent(java.lang.String channelName, ConfigurableServerChannel.Initializer... initializers)
createChannelIfAbsent in interface BayeuxServerpublic java.util.List<ServerSession> getSessions()
getSessions in interface BayeuxServerpublic boolean removeSession(ServerSession session)
removeSession in interface BayeuxServerpublic ServerSession getSession(java.lang.String clientId)
getSession in interface BayeuxServerprotected void addServerSession(ServerSessionImpl session, ServerMessage message)
public boolean removeServerSession(ServerSession session, boolean timedOut)
session - the session to removetimedOut - whether the remove reason is server-side expirationpublic ServerSessionImpl newServerSession()
public LocalSession newLocalSession(java.lang.String idHint)
newLocalSession in interface BayeuxServerpublic ServerMessage.Mutable newMessage()
newMessage in interface BayeuxServerpublic ServerMessage.Mutable newMessage(ServerMessage tocopy)
public void setSecurityPolicy(SecurityPolicy securityPolicy)
setSecurityPolicy in interface BayeuxServerpublic void addExtension(BayeuxServer.Extension extension)
addExtension in interface BayeuxServerpublic void removeExtension(BayeuxServer.Extension extension)
removeExtension in interface BayeuxServerpublic java.util.List<BayeuxServer.Extension> getExtensions()
getExtensions in interface BayeuxServerpublic void addListener(BayeuxServer.BayeuxServerListener listener)
addListener in interface BayeuxServerpublic ServerChannel getChannel(java.lang.String channelId)
getChannel in interface BayeuxServerpublic java.util.List<ServerChannel> getChannels()
getChannels in interface BayeuxServerpublic void removeListener(BayeuxServer.BayeuxServerListener listener)
removeListener in interface BayeuxServerpublic ServerMessage.Mutable handle(ServerSessionImpl session, ServerMessage.Mutable message)
protected void validateMessage(ServerMessage.Mutable message)
protected void doPublish(ServerSessionImpl from, ServerChannelImpl to, ServerMessage.Mutable mutable, boolean receiving)
public void freeze(ServerMessage.Mutable mutable)
public ServerMessage.Mutable extendReply(ServerSessionImpl from, ServerSessionImpl to, ServerMessage.Mutable reply)
protected boolean extendRecv(ServerSession from, ServerMessage.Mutable message)
protected boolean extendSend(ServerSession from, ServerSession to, ServerMessage.Mutable message)
protected boolean removeServerChannel(ServerChannelImpl channel)
protected java.util.List<BayeuxServer.BayeuxServerListener> getListeners()
public java.util.Set<java.lang.String> getKnownTransportNames()
getKnownTransportNames in interface Bayeuxpublic ServerTransport getTransport(java.lang.String transport)
getTransport in interface Bayeuxpublic ServerTransport addTransport(ServerTransport transport)
public void setTransports(ServerTransport... transports)
public void setTransports(java.util.List<ServerTransport> transports)
public java.util.List<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 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(ServerMessage.Mutable reply)
protected void error(ServerMessage.Mutable reply, java.lang.String error)
protected ServerMessage.Mutable createReply(ServerMessage.Mutable message)
@ManagedOperation(value="Sweeps channels and sessions of this BayeuxServer",
impact="ACTION")
public void sweep()
@ManagedAttribute(value="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–2019 The CometD Project. All rights reserved.