|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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 dojox.cometd.Bayeux |
---|
ADVICE_FIELD, CHANNEL_FIELD, CLIENT_FIELD, CONNECTION_TYPE_FIELD, DATA_FIELD, DOJOX_COMETD_BAYEUX, 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, SUPP_CONNECTION_TYPE_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 |
addClient(ClientImpl client,
String idPrefix)
|
void |
addExtension(dojox.cometd.Extension ext)
|
void |
addFilter(String channels,
dojox.cometd.DataFilter filter)
Deprecated. user Channel#addFilter |
void |
deliver(dojox.cometd.Client fromClient,
dojox.cometd.Client toClient,
String toChannel,
dojox.cometd.Message message)
Deprecated. use Client.deliver(Client, Message) |
protected void |
doPublish(ChannelId to,
dojox.cometd.Client from,
Object data,
String msgId)
Publish data to a channel. |
Object |
getAdvice()
|
ChannelImpl |
getChannel(ChannelId id)
|
ChannelImpl |
getChannel(String id)
|
dojox.cometd.Channel |
getChannel(String id,
boolean create)
|
ChannelId |
getChannelId(String id)
|
Collection<dojox.cometd.Channel> |
getChannels()
|
dojox.cometd.Client |
getClient(String client_id)
|
Set<String> |
getClientIDs()
|
Collection<dojox.cometd.Client> |
getClients()
|
HttpServletRequest |
getCurrentRequest()
|
List<dojox.cometd.Extension> |
getExtensions()
|
long |
getInterval()
|
int |
getLogLevel()
|
long |
getMaxInterval()
|
int |
getMultiFrameInterval()
|
dojox.cometd.SecurityPolicy |
getSecurityPolicy()
|
long |
getTimeout()
|
String |
handle(ClientImpl client,
Transport transport,
dojox.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()
|
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)
|
dojox.cometd.Client |
newClient(String idPrefix)
|
dojox.cometd.Client |
newClient(String idPrefix,
dojox.cometd.Listener listener)
Deprecated. use newClient(String) |
protected String |
newClientId(long variation,
String idPrefix)
|
abstract ClientImpl |
newRemoteClient()
|
Transport |
newTransport(ClientImpl client,
Map<?,?> message)
Create new transport object for a bayeux message |
void |
publish(dojox.cometd.Client fromClient,
String toChannelId,
Object data,
String msgId)
Deprecated. use Channel.publish(Client, Object, String) |
boolean |
removeChannel(ChannelId channelId)
|
dojox.cometd.Channel |
removeChannel(String channelId)
|
dojox.cometd.Client |
removeClient(String client_id)
|
void |
removeExtension(dojox.cometd.Extension ext)
|
void |
removeFilter(String channels,
dojox.cometd.DataFilter filter)
|
void |
setAdvice(Object advice)
|
void |
setDirectDeliver(boolean directDeliver)
|
void |
setInterval(long ms)
|
void |
setJSONCommented(boolean commented)
|
void |
setLogLevel(int logLevel)
|
void |
setMaxInterval(long 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(dojox.cometd.SecurityPolicy securityPolicy)
|
void |
setTimeout(long ms)
|
void |
subscribe(String toChannel,
dojox.cometd.Client subscriber)
|
void |
unsubscribe(String toChannel,
dojox.cometd.Client subscriber)
|
Methods inherited from class org.mortbay.cometd.MessagePool |
---|
getBatchJSON, getJSON, getMsgJSON, newMessage, newMessage, parse, parse, parseTo, recycleMessage, setBatchJSON, setJSON, setMsgJSON |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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
public static final JSON.Literal TRANSPORTS
protected dojox.cometd.SecurityPolicy _securityPolicy
protected Object _advice
protected int _adviceVersion
protected Object _unknownAdvice
protected int _logLevel
protected long _timeout
protected long _interval
protected long _maxInterval
protected boolean _JSONCommented
protected boolean _initialized
protected ConcurrentHashMap<String,List<String>> _browser2client
protected int _multiFrameInterval
protected JSON.Literal _multiFrameAdvice
protected boolean _directDeliver
protected boolean _requestAvailable
protected ThreadLocal<HttpServletRequest> _request
protected AbstractBayeux.Handler _publishHandler
protected AbstractBayeux.Handler _metaPublishHandler
protected List<dojox.cometd.Extension> _extensions
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 addFilter(String channels, dojox.cometd.DataFilter filter)
Channel#addFilter
addFilter
in interface dojox.cometd.Bayeux
channels
- A ChannelId
filter
- The filter instance to apply to new channels matching the
patternpublic void removeFilter(String channels, dojox.cometd.DataFilter filter)
removeFilter
in interface dojox.cometd.Bayeux
public void addExtension(dojox.cometd.Extension ext)
public List<dojox.cometd.Extension> getExtensions()
public void removeExtension(dojox.cometd.Extension ext)
public ChannelImpl getChannel(ChannelId id)
id
-
public ChannelImpl getChannel(String id)
public dojox.cometd.Channel getChannel(String id, boolean create)
getChannel
in interface dojox.cometd.Bayeux
public ChannelId getChannelId(String id)
public dojox.cometd.Client getClient(String client_id)
getClient
in interface dojox.cometd.Bayeux
public Set<String> getClientIDs()
public long getMaxInterval()
public int getLogLevel()
public dojox.cometd.SecurityPolicy getSecurityPolicy()
getSecurityPolicy
in interface dojox.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, dojox.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 dojox.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 dojox.cometd.Client newClient(String idPrefix)
newClient
in interface dojox.cometd.Bayeux
public dojox.cometd.Client newClient(String idPrefix, dojox.cometd.Listener listener)
newClient(String)
newClient
in interface dojox.cometd.Bayeux
public abstract ClientImpl newRemoteClient()
public Transport newTransport(ClientImpl client, Map<?,?> message)
client
- The clientmessage
- the bayeux message
protected void doPublish(ChannelId to, dojox.cometd.Client from, Object data, String msgId)
to
- from
- data
- msgId
- public void publish(dojox.cometd.Client fromClient, String toChannelId, Object data, String msgId)
Channel.publish(Client, Object, String)
publish
in interface dojox.cometd.Bayeux
public void deliver(dojox.cometd.Client fromClient, dojox.cometd.Client toClient, String toChannel, dojox.cometd.Message message)
Client.deliver(Client, Message)
deliver
in interface dojox.cometd.Bayeux
Bayeux.deliver(dojox.cometd.Client, dojox.cometd.Client, java.lang.String, dojox.cometd.Message)
public boolean removeChannel(ChannelId channelId)
protected String newClientId(long variation, String idPrefix)
protected void addClient(ClientImpl client, String idPrefix)
public dojox.cometd.Client removeClient(String client_id)
removeClient
in interface dojox.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(dojox.cometd.SecurityPolicy securityPolicy)
setSecurityPolicy
in interface dojox.cometd.Bayeux
public void setTimeout(long ms)
public void setInterval(long ms)
public boolean isRequestAvailable()
getCurrentRequest()
will return the current requestpublic void setRequestAvailable(boolean requestAvailable)
requestAvailable
- TRUE if getCurrentRequest()
will return the current requestpublic HttpServletRequest getCurrentRequest()
isRequestAvailable()
is true, else nullpublic void subscribe(String toChannel, dojox.cometd.Client subscriber)
subscribe
in interface dojox.cometd.Bayeux
public void unsubscribe(String toChannel, dojox.cometd.Client subscriber)
unsubscribe
in interface dojox.cometd.Bayeux
public int getMultiFrameInterval()
public void setMultiFrameInterval(int multiFrameInterval)
multiFrameInterval
- the multiFrameInterval to setpublic Object getAdvice()
public void setAdvice(Object advice)
public Collection<dojox.cometd.Channel> getChannels()
getChannels
in interface dojox.cometd.Bayeux
public Collection<dojox.cometd.Client> getClients()
getClients
in interface dojox.cometd.Bayeux
public boolean hasClient(String clientId)
hasClient
in interface dojox.cometd.Bayeux
public dojox.cometd.Channel removeChannel(String channelId)
removeChannel
in interface dojox.cometd.Bayeux
protected void initialize(ServletContext context)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |