@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 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 |
FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPINGATTRIBUTE| Constructor and Description |
|---|
BayeuxServerImpl() |
public static final String ALLOWED_TRANSPORTS_OPTION
public static final String SWEEP_PERIOD_OPTION
public static final String TRANSPORTS_OPTION
public static final String VALIDATE_MESSAGE_FIELDS_OPTION
public static final String BROADCAST_TO_PUBLISHER_OPTION
protected void doStart()
throws Exception
doStart in class org.eclipse.jetty.util.component.AbstractLifeCycleExceptionprotected void doStop()
throws Exception
doStop in class org.eclipse.jetty.util.component.AbstractLifeCycleExceptionprotected void initializeMetaChannels()
protected void initializeServerTransports()
public org.eclipse.jetty.util.thread.Scheduler.Task schedule(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 task@ManagedOperation(value="The value of the given configuration option",
impact="INFO")
public Object getOption(@Name(value="optionName")
String qualifiedName)
protected long getOption(String name, long dft)
protected boolean getOption(String name, boolean dft)
public Set<String> getOptionNames()
getOptionNames in interface Bayeuxpublic 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(String channelName, ConfigurableServerChannel.Initializer... initializers)
createChannelIfAbsent in interface BayeuxServerpublic List<ServerSession> getSessions()
getSessions in interface BayeuxServerpublic boolean removeSession(ServerSession session)
removeSession in interface BayeuxServerpublic ServerSession getSession(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(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 List<BayeuxServer.Extension> getExtensions()
getExtensions in interface BayeuxServerpublic void addListener(BayeuxServer.BayeuxServerListener listener)
addListener in interface BayeuxServerpublic ServerChannel getChannel(String channelId)
getChannel in interface BayeuxServerpublic 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 List<BayeuxServer.BayeuxServerListener> getListeners()
public Set<String> getKnownTransportNames()
getKnownTransportNames in interface Bayeuxpublic ServerTransport getTransport(String transport)
getTransport in interface Bayeuxpublic ServerTransport addTransport(ServerTransport transport)
public void setTransports(ServerTransport... transports)
public void setTransports(List<ServerTransport> transports)
public List<ServerTransport> getTransports()
protected AbstractHttpTransport findHttpTransport(javax.servlet.http.HttpServletRequest request)
@ManagedAttribute(value="The transports allowed by this server",
readonly=true)
public List<String> getAllowedTransports()
getAllowedTransports in interface Bayeuxpublic void setAllowedTransports(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, 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 String dump()
dump in interface org.eclipse.jetty.util.component.Dumpablepublic void dump(Appendable out, String indent) throws IOException
dump in interface org.eclipse.jetty.util.component.DumpableIOExceptionCopyright © 2008–2017 The CometD Project. All rights reserved.