|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mortbay.cometd.MessagePool org.mortbay.cometd.AbstractBayeux
public abstract class AbstractBayeux
Nested Class Summary | |
---|---|
protected class |
AbstractBayeux.ConnectHandler
|
static class |
AbstractBayeux.DefaultPolicy
|
protected class |
AbstractBayeux.DisconnectHandler
|
protected class |
AbstractBayeux.Handler
|
protected class |
AbstractBayeux.HandshakeHandler
|
protected class |
AbstractBayeux.MetaPublishHandler
|
protected class |
AbstractBayeux.PingHandler
|
protected class |
AbstractBayeux.PublishHandler
|
protected class |
AbstractBayeux.ServiceChannel
|
protected class |
AbstractBayeux.SubscribeHandler
|
protected class |
AbstractBayeux.UnsubscribeHandler
|
Fields inherited from interface org.cometd.Bayeux |
---|
ADVICE_FIELD, ATTRIBUTE, CHANNEL_FIELD, CLIENT_FIELD, CONNECTION_TYPE_FIELD, DATA_FIELD, ERROR_FIELD, EXT_FIELD, HANDSHAKE_RESPONSE, ID_FIELD, INTERVAL_FIELD, JSON_COMMENT_FILTERED_FIELD, JSON_CONTENT_TYPE, JSONP_DEFAULT_NAME, JSONP_PARAMETER, MESSAGE_PARAMETER, META, META_CLIENT, META_CONNECT, META_DISCONNECT, META_HANDSHAKE, META_PING, META_SLASH, META_STATUS, META_SUBSCRIBE, META_UNSUBSCRIBE, MIN_VERSION_FIELD, NONE_RESPONSE, RECONNECT_FIELD, RETRY_RESPONSE, SERVICE, SERVICE_SLASH, SUBSCRIPTION_FIELD, SUCCESSFUL_FIELD, SUPPORTED_CONNECTION_TYPES_FIELD, TIMESTAMP_FIELD, TRANSPORT_CALLBACK_POLL, TRANSPORT_FIELD, TRANSPORT_FLASH, TRANSPORT_IFRAME, TRANSPORT_LONG_POLL, VERSION_FIELD |
Constructor Summary | |
---|---|
protected |
AbstractBayeux()
|
Method Summary | |
---|---|
protected void |
addChannel(ChannelImpl channel)
|
protected void |
addClient(ClientImpl client,
String idPrefix)
|
void |
addExtension(org.cometd.Extension ext)
|
void |
addListener(org.cometd.BayeuxListener listener)
|
protected void |
doPublish(ChannelId to,
org.cometd.Client from,
Object data,
String msgId,
boolean lazy)
Publish data to a channel. |
protected org.cometd.Message |
extendRcv(ClientImpl from,
org.cometd.Message message)
|
protected org.cometd.Message |
extendRcvMeta(ClientImpl from,
org.cometd.Message message)
|
protected org.cometd.Message |
extendSendBayeux(org.cometd.Client from,
org.cometd.Message message)
|
org.cometd.Message |
extendSendClient(org.cometd.Client from,
ClientImpl to,
org.cometd.Message message)
|
org.cometd.Message |
extendSendMeta(ClientImpl from,
org.cometd.Message message)
|
JSON.Literal |
getAdvice()
|
ChannelImpl |
getChannel(ChannelId id)
|
ChannelImpl |
getChannel(String id)
|
org.cometd.Channel |
getChannel(String id,
boolean create)
|
int |
getChannelCount()
|
ChannelId |
getChannelId(String id)
|
Collection<org.cometd.Channel> |
getChannels()
|
org.cometd.Client |
getClient(String client_id)
|
int |
getClientCount()
|
Set<String> |
getClientIDs()
|
Collection<org.cometd.Client> |
getClients()
|
HttpServletRequest |
getCurrentRequest()
|
long |
getInterval()
|
int |
getLogLevel()
|
int |
getMaxClientQueue()
|
long |
getMaxInterval()
|
int |
getMaxLazyLatency()
|
int |
getMultiFrameInterval()
|
org.cometd.SecurityPolicy |
getSecurityPolicy()
|
long |
getTimeout()
|
String |
handle(ClientImpl client,
Transport transport,
org.cometd.Message message)
Handle a Bayeux message. |
boolean |
hasChannel(String id)
|
boolean |
hasClient(String clientId)
|
protected void |
initialize(ServletContext context)
|
boolean |
isDirectDeliver()
|
boolean |
isInitialized()
|
boolean |
isJSONCommented()
Deprecated. |
boolean |
isLogDebug()
|
boolean |
isLogInfo()
|
boolean |
isRequestAvailable()
|
void |
logDebug(String message)
|
void |
logDebug(String message,
Throwable th)
|
void |
logInfo(String message)
|
void |
logWarn(String message)
|
void |
logWarn(String message,
Throwable th)
|
org.cometd.Client |
newClient(String idPrefix)
|
protected String |
newClientId(long variation,
String idPrefix)
|
abstract ClientImpl |
newRemoteClient()
|
Transport |
newTransport(ClientImpl client,
Map<?,?> message)
Create new transport object for a bayeux message |
boolean |
removeChannel(ChannelImpl channel)
|
org.cometd.Channel |
removeChannel(String channelId)
|
org.cometd.Client |
removeClient(String client_id)
|
void |
setAdvice(JSON.Literal advice)
|
void |
setDirectDeliver(boolean directDeliver)
Deprecated. |
void |
setInterval(long ms)
|
void |
setJSONCommented(boolean commented)
|
void |
setLogLevel(int logLevel)
|
void |
setMaxClientQueue(int size)
|
void |
setMaxInterval(long ms)
|
void |
setMaxLazyLatency(int ms)
|
void |
setMultiFrameInterval(int multiFrameInterval)
The time a client should delay between reconnects when multiple connections from the same browser are detected. |
void |
setRequestAvailable(boolean requestAvailable)
|
void |
setSecurityPolicy(org.cometd.SecurityPolicy securityPolicy)
|
void |
setTimeout(long ms)
|
Methods inherited from class org.mortbay.cometd.MessagePool |
---|
getBatchJSON, getJSON, getMsgJSON, newMessage, newMessage, parse, parse, parseTo, setBatchJSON, setJSON, setMsgJSON, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final ChannelId META_ID
public static final ChannelId META_CONNECT_ID
public static final ChannelId META_CLIENT_ID
public static final ChannelId META_DISCONNECT_ID
public static final ChannelId META_HANDSHAKE_ID
public static final ChannelId META_PING_ID
public static final ChannelId META_STATUS_ID
public static final ChannelId META_SUBSCRIBE_ID
public static final ChannelId META_UNSUBSCRIBE_ID
protected final ConcurrentHashMap<String,ChannelId> _channelIdCache
protected final ConcurrentHashMap<String,List<String>> _browser2client
protected final ThreadLocal<HttpServletRequest> _request
protected final List<org.cometd.ClientBayeuxListener> _clientListeners
protected final List<org.cometd.ChannelBayeuxListener> _channelListeners
protected final AbstractBayeux.Handler _publishHandler
protected final AbstractBayeux.Handler _metaPublishHandler
protected org.cometd.SecurityPolicy _securityPolicy
protected JSON.Literal _advice
protected JSON.Literal _multiFrameAdvice
protected int _adviceVersion
protected Object _handshakeAdvice
protected int _logLevel
protected long _timeout
protected long _interval
protected long _maxInterval
protected boolean _initialized
protected int _multiFrameInterval
protected boolean _requestAvailable
protected int _maxClientQueue
protected org.cometd.Extension[] _extensions
protected JSON.Literal _transports
protected JSON.Literal _replyExt
protected int _maxLazyLatency
Constructor Detail |
---|
protected AbstractBayeux()
context
- The logLevel init parameter is used to set the logging to: 0=none, 1=info, 2=debugMethod Detail |
---|
public void addExtension(org.cometd.Extension ext)
addExtension
in interface org.cometd.Bayeux
public ChannelImpl getChannel(ChannelId id)
id
-
public ChannelImpl getChannel(String id)
public org.cometd.Channel getChannel(String id, boolean create)
getChannel
in interface org.cometd.Bayeux
public ChannelId getChannelId(String id)
public org.cometd.Client getClient(String client_id)
getClient
in interface org.cometd.Bayeux
public Set<String> getClientIDs()
public long getMaxInterval()
public int getLogLevel()
public org.cometd.SecurityPolicy getSecurityPolicy()
getSecurityPolicy
in interface org.cometd.Bayeux
public long getTimeout()
public long getInterval()
public boolean isDirectDeliver()
public void setDirectDeliver(boolean directDeliver)
directDeliver
- true if published messages are directly delivered to
subscribers. False if a new message is to be created that
holds only supported fields.public String handle(ClientImpl client, Transport transport, org.cometd.Message message) throws IOException
client
- The client if knowntransport
- The transport to use for the messagemessage
- The bayeux message.
IOException
public boolean hasChannel(String id)
hasChannel
in interface org.cometd.Bayeux
public boolean isInitialized()
public boolean isJSONCommented()
public boolean isLogDebug()
public boolean isLogInfo()
public void logDebug(String message)
public void logDebug(String message, Throwable th)
public void logWarn(String message, Throwable th)
public void logWarn(String message)
public void logInfo(String message)
public org.cometd.Client newClient(String idPrefix)
newClient
in interface org.cometd.Bayeux
public abstract ClientImpl newRemoteClient()
public Transport newTransport(ClientImpl client, Map<?,?> message)
client
- The clientmessage
- the bayeux message
protected void doPublish(ChannelId to, org.cometd.Client from, Object data, String msgId, boolean lazy)
to
- from
- data
- msgId
- public boolean removeChannel(ChannelImpl channel)
protected void addChannel(ChannelImpl channel)
protected String newClientId(long variation, String idPrefix)
protected void addClient(ClientImpl client, String idPrefix)
public org.cometd.Client removeClient(String client_id)
removeClient
in interface org.cometd.Bayeux
public void setMaxInterval(long ms)
ms
- The maximum time in ms to wait between polls before timing out
a clientpublic void setJSONCommented(boolean commented)
commented
- the commented to setpublic void setLogLevel(int logLevel)
logLevel
- the logLevel: 0=none, 1=info, 2=debugpublic void setSecurityPolicy(org.cometd.SecurityPolicy securityPolicy)
setSecurityPolicy
in interface org.cometd.Bayeux
public void setTimeout(long ms)
public void setInterval(long ms)
public void setMultiFrameInterval(int multiFrameInterval)
multiFrameInterval
- the multiFrameInterval to setpublic int getMultiFrameInterval()
public void setAdvice(JSON.Literal advice)
public JSON.Literal getAdvice()
public boolean isRequestAvailable()
getCurrentRequest()
will return the current
requestpublic void setRequestAvailable(boolean requestAvailable)
requestAvailable
- TRUE if getCurrentRequest()
will return the current
requestpublic HttpServletRequest getCurrentRequest()
getCurrentRequest
in interface org.cometd.Bayeux
isRequestAvailable()
is true,
else nullpublic Collection<org.cometd.Channel> getChannels()
getChannels
in interface org.cometd.Bayeux
public int getChannelCount()
public Collection<org.cometd.Client> getClients()
getClients
in interface org.cometd.Bayeux
public int getClientCount()
public boolean hasClient(String clientId)
hasClient
in interface org.cometd.Bayeux
public org.cometd.Channel removeChannel(String channelId)
removeChannel
in interface org.cometd.Bayeux
protected void initialize(ServletContext context)
public void addListener(org.cometd.BayeuxListener listener)
addListener
in interface org.cometd.Bayeux
public int getMaxClientQueue()
getMaxClientQueue
in interface org.cometd.Bayeux
public void setMaxClientQueue(int size)
setMaxClientQueue
in interface org.cometd.Bayeux
protected org.cometd.Message extendRcv(ClientImpl from, org.cometd.Message message)
protected org.cometd.Message extendRcvMeta(ClientImpl from, org.cometd.Message message)
protected org.cometd.Message extendSendBayeux(org.cometd.Client from, org.cometd.Message message)
public org.cometd.Message extendSendClient(org.cometd.Client from, ClientImpl to, org.cometd.Message message)
public org.cometd.Message extendSendMeta(ClientImpl from, org.cometd.Message message)
public int getMaxLazyLatency()
public void setMaxLazyLatency(int ms)
ms
- the maximum ms that a lazy message will wait before
resuming waiting client
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |