public class BayeuxServerImpl extends org.eclipse.jetty.util.component.AbstractLifeCycle implements BayeuxServer
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListenerBayeuxServer.BayeuxServerListener, BayeuxServer.ChannelListener, BayeuxServer.Extension, BayeuxServer.SessionListener, BayeuxServer.SubscriptionListenerBayeux.BayeuxListener| Modifier and Type | Field and Description |
|---|---|
static int |
CONFIG_LOG_LEVEL |
static int |
DEBUG_LOG_LEVEL |
static int |
INFO_LOG_LEVEL |
static String |
JSON_CONTEXT |
static String |
LOG_LEVEL |
static int |
OFF_LOG_LEVEL |
FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPINGATTRIBUTE| Constructor and Description |
|---|
BayeuxServerImpl() |
public static final String LOG_LEVEL
public static final int OFF_LOG_LEVEL
public static final int CONFIG_LOG_LEVEL
public static final int INFO_LOG_LEVEL
public static final int DEBUG_LOG_LEVEL
public static final String JSON_CONTEXT
public org.slf4j.Logger getLogger()
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 initializeDefaultTransports()
This method creates a JSONTransport and a JSONPTransport.
If no allowed transport have been set then adds all known transports as allowed transports.
public void startTimeout(org.eclipse.jetty.util.thread.Timeout.Task task,
long interval)
public void cancelTimeout(org.eclipse.jetty.util.thread.Timeout.Task task)
public Object getOption(String qualifiedName)
getOption in interface BayeuxBayeux.getOption(java.lang.String)protected long getOption(String name, long dft)
name - The option namedft - The default valuepublic Set<String> getOptionNames()
getOptionNames in interface BayeuxBayeux.getOptionNames()public void setOption(String qualifiedName, Object value)
setOption in interface BayeuxBayeux.setOption(java.lang.String, java.lang.Object)public long randomLong()
public void setCurrentTransport(AbstractServerTransport transport)
public ServerTransport getCurrentTransport()
getCurrentTransport in interface BayeuxServerpublic BayeuxContext getContext()
getContext in interface BayeuxServerpublic SecurityPolicy getSecurityPolicy()
getSecurityPolicy in interface BayeuxServerpublic boolean createIfAbsent(String channelName, ConfigurableServerChannel.Initializer... initializers)
createIfAbsent in interface BayeuxServerpublic List<ServerSession> getSessions()
getSessions in interface BayeuxServerpublic ServerSession getSession(String clientId)
getSession in interface BayeuxServerprotected void addServerSession(ServerSessionImpl session)
public boolean removeServerSession(ServerSession session, boolean timedout)
session - the session to removetimedout - whether the remove reason is server-side expirationprotected 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)
session - The session if knownmessage - The message.protected void doPublish(ServerSessionImpl from, ServerChannelImpl to, ServerMessage.Mutable mutable)
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 void addTransport(ServerTransport transport)
public void setTransports(ServerTransport... transports)
public void setTransports(List<ServerTransport> transports)
public List<ServerTransport> getTransports()
public List<String> getAllowedTransports()
getAllowedTransports in interface Bayeuxpublic void setAllowedTransports(String... allowed)
protected void unknownSession(ServerMessage.Mutable reply)
protected void error(ServerMessage.Mutable reply, String error)
protected ServerMessage.Mutable createReply(ServerMessage.Mutable message)
public void sweep()
public String dump()
Copyright © 2008-2012 Dojo Foundation. All Rights Reserved.