@ManagedObject(value="The CometD server") public class BayeuxServerImpl extends org.eclipse.jetty.util.component.ContainerLifeCycle implements BayeuxServer, org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListenerBayeuxServer.BayeuxServerListener, BayeuxServer.ChannelListener, BayeuxServer.Extension, BayeuxServer.SessionListener, BayeuxServer.SubscriptionListenerorg.cometd.bayeux.Bayeux.BayeuxListener, org.cometd.bayeux.Bayeux.Validatororg.eclipse.jetty.util.component.Dumpable.DumpableContainer| Modifier and Type | Field and Description |
|---|---|
static String |
ALLOWED_TRANSPORTS_OPTION |
static String |
BROADCAST_TO_PUBLISHER_OPTION |
static String |
EXECUTOR_MAX_THREADS |
static String |
SCHEDULER_THREADS |
static String |
SWEEP_PERIOD_OPTION |
static String |
SWEEP_THREADS_OPTION |
static String |
TRANSPORTS_OPTION |
static String |
VALIDATE_MESSAGE_FIELDS_OPTION |
FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPINGATTRIBUTE| Constructor and Description |
|---|
BayeuxServerImpl() |
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeansaddLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdump, dump, dumpContainer, dumpIterable, dumpMapEntries, dumpObject, dumpObjects, dumpSelf, namedpublic static final String ALLOWED_TRANSPORTS_OPTION
public static final String SWEEP_PERIOD_OPTION
public static final String SWEEP_THREADS_OPTION
public static final String TRANSPORTS_OPTION
public static final String VALIDATE_MESSAGE_FIELDS_OPTION
public static final String BROADCAST_TO_PUBLISHER_OPTION
public static final String SCHEDULER_THREADS
public static final String EXECUTOR_MAX_THREADS
public String getName()
protected void doStart()
throws Exception
doStart in class org.eclipse.jetty.util.component.ContainerLifeCycleExceptionprotected void doStop()
throws Exception
doStop in class org.eclipse.jetty.util.component.ContainerLifeCycleExceptionprotected void initializeMetaChannels()
protected void initializeServerTransports()
public void setExecutor(Executor executor)
public Executor getExecutor()
public void execute(Runnable job)
public void setScheduler(org.eclipse.jetty.util.thread.Scheduler scheduler)
public org.eclipse.jetty.util.thread.Scheduler getScheduler()
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 taskpublic org.cometd.bayeux.ChannelId newChannelId(String id)
@ManagedOperation(value="The value of the given configuration option",
impact="INFO")
public Object getOption(@Name(value="optionName")
String qualifiedName)
getOption in interface org.cometd.bayeux.Bayeuxprotected long getOption(String name, long dft)
protected boolean getOption(String name, boolean dft)
public Set<String> getOptionNames()
getOptionNames in interface org.cometd.bayeux.Bayeuxpublic void setOption(String qualifiedName, Object value)
setOption in interface org.cometd.bayeux.Bayeuxpublic long randomLong()
public SecurityPolicy getSecurityPolicy()
getSecurityPolicy in interface BayeuxServerpublic JSONContextServer getJSONContext()
public org.cometd.bayeux.MarkedReference<ServerChannel> createChannelIfAbsent(String channelName, ConfigurableServerChannel.Initializer... initializers)
createChannelIfAbsent in interface BayeuxServerpublic List<ServerSession> getSessions()
getSessions in interface BayeuxServerpublic ServerSession getSession(String clientId)
getSession in interface BayeuxServerprotected void addServerSession(ServerSessionImpl session, ServerMessage message)
public boolean removeSession(ServerSession session)
removeSession in interface BayeuxServerpublic boolean removeServerSession(ServerSession session, boolean timeout)
session - the session to removetimeout - whether the session has been removed due to a timeoutpublic ServerSessionImpl newServerSession()
public LocalSession newLocalSession(String idHint)
newLocalSession in interface BayeuxServerpublic ServerMessage.Mutable newMessage()
newMessage in interface BayeuxServerpublic ServerMessage.Mutable newMessage(ServerMessage original)
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 void handle(ServerSessionImpl session, ServerMessage.Mutable message, org.cometd.bayeux.Promise<ServerMessage.Mutable> promise)
protected String validateMessage(ServerMessage.Mutable message)
protected void publish(ServerSessionImpl session, ServerChannelImpl channel, ServerMessage.Mutable message, boolean receiving, org.cometd.bayeux.Promise<Boolean> promise)
protected org.cometd.bayeux.Promise<Boolean> resolveLoop(AsyncFoldLeft.Loop<Boolean> loop)
public void freeze(ServerMessage.Mutable mutable)
protected void extendOutgoing(ServerSession sender, ServerSession session, ServerMessage.Mutable message, org.cometd.bayeux.Promise<Boolean> promise)
public void extendReply(ServerSessionImpl sender, ServerSessionImpl session, ServerMessage.Mutable reply, org.cometd.bayeux.Promise<ServerMessage.Mutable> promise)
protected boolean removeServerChannel(ServerChannelImpl channel)
protected List<BayeuxServer.BayeuxServerListener> getListeners()
public Set<String> getKnownTransportNames()
getKnownTransportNames in interface org.cometd.bayeux.Bayeuxpublic ServerTransport getTransport(String transport)
getTransport in interface org.cometd.bayeux.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 CoemtD server",
readonly=true)
public List<String> getAllowedTransports()
getAllowedTransports in interface org.cometd.bayeux.Bayeuxpublic void setAllowedTransports(String... allowed)
@ManagedAttribute(value="Whether this CometD 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 CometD server",
impact="ACTION")
public void sweep()
@ManagedAttribute(value="Reports additional details in the dump() operation") public boolean isDetailedDump()
public void setDetailedDump(boolean detailedDump)
@ManagedAttribute(value="The period, in milliseconds, of the sweeping activity performed by the server") public long getSweepPeriod()
public void setSweepPeriod(long sweepPeriod)
@ManagedAttribute(value="The maximum number of threads that can be used by the sweeping activity performed by the server") public int getSweepThreads()
public void setSweepThreads(int sweepThreads)
public void dump(Appendable out, String indent) throws IOException
dump in interface org.eclipse.jetty.util.component.Dumpabledump in class org.eclipse.jetty.util.component.ContainerLifeCycleIOExceptionCopyright © 2008–2023 The CometD Project. All rights reserved.