|
||||||||||
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 | |
---|---|
static class |
AbstractBayeux.DefaultPolicy
|
Field Summary | |
---|---|
protected List<Extension> |
_extensions
|
protected org.mortbay.cometd.AbstractBayeux.Handler |
_publishHandler
|
static ChannelId |
META_CLIENT_ID
|
static ChannelId |
META_CONNECT_ID
|
static ChannelId |
META_DISCONNECT_ID
|
static ChannelId |
META_HANDSHAKE_ID
|
static ChannelId |
META_ID
|
static ChannelId |
META_PING_ID
|
static ChannelId |
META_RECONNECT_ID
|
static ChannelId |
META_STATUS_ID
|
static ChannelId |
META_SUBSCRIBE_ID
|
static ChannelId |
META_UNSUBSCRIBE_ID
|
static JSON.Literal |
TRANSPORTS
|
Fields inherited from interface dojox.cometd.Bayeux |
---|
ADVICE_FIELD, CHANNEL_FIELD, CLIENT_FIELD, DATA_FIELD, DOJOX_COMETD_BAYEUX, ERROR_FIELD, EXT_FIELD, ID_FIELD, META, META_CLIENT, META_CONNECT, META_DISCONNECT, META_HANDSHAKE, META_PING, META_RECONNECT, META_SLASH, META_STATUS, META_SUBSCRIBE, META_UNSUBSCRIBE, SERVICE, SERVICE_SLASH, SUBSCRIPTION_FIELD, SUCCESSFUL_FIELD, TIMESTAMP_FIELD, TRANSPORT_FIELD |
Constructor Summary | |
---|---|
protected |
AbstractBayeux()
|
Method Summary | |
---|---|
void |
addExtension(Extension ext)
|
void |
addFilter(String channels,
DataFilter filter)
|
void |
deliver(Client fromClient,
Client toClient,
String toChannel,
Message message)
Deliver a message to a client. |
Object |
getAdvice()
|
ChannelImpl |
getChannel(ChannelId id)
|
ChannelImpl |
getChannel(String id)
|
Channel |
getChannel(String id,
boolean create)
|
ChannelId |
getChannelId(String id)
|
Client |
getClient(String client_id)
|
Set |
getClientIDs()
|
List<Extension> |
getExtensions()
|
int |
getLogLevel()
|
long |
getMaxInterval()
|
int |
getMultiFrameInterval()
|
long |
getRandom(long variation)
|
SecurityPolicy |
getSecurityPolicy()
|
String |
handle(ClientImpl client,
Transport transport,
Message message)
Handle a Bayeux message. |
boolean |
hasChannel(String id)
|
protected void |
initialize(ServletContext context)
|
boolean |
isInitialized()
|
boolean |
isJSONCommented()
|
boolean |
isLogDebug()
|
boolean |
isLogInfo()
|
void |
logDebug(String message)
|
void |
logDebug(String message,
Throwable th)
|
void |
logInfo(String message)
|
void |
logWarn(String message)
|
void |
logWarn(String message,
Throwable th)
|
Client |
newClient(String idPrefix,
Listener listener)
|
abstract ClientImpl |
newRemoteClient()
|
Transport |
newTransport(ClientImpl client,
Map message)
Create new transport object for a bayeux message |
void |
publish(ChannelId to,
Client from,
Object data,
String msgId)
|
void |
publish(Client fromClient,
String toChannelId,
Object data,
String msgId)
Deliver data to a channel. |
boolean |
removeChannel(ChannelId channelId)
|
void |
removeExtension(Extension ext)
|
void |
removeFilter(String channels,
DataFilter filter)
|
void |
setAdvice(Object advice)
|
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 |
setSecurityPolicy(SecurityPolicy securityPolicy)
|
void |
subscribe(String toChannel,
Client subscriber)
Subscribe to a channel. |
void |
unsubscribe(String toChannel,
Client subscriber)
Unsubscribe to a channel |
Methods inherited from class org.mortbay.cometd.MessagePool |
---|
getBatchJSON, getJSON, getMsgJSON, 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 |
Methods inherited from interface dojox.cometd.Bayeux |
---|
newMessage |
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_RECONNECT_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 org.mortbay.cometd.AbstractBayeux.Handler _publishHandler
protected List<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, DataFilter filter)
addFilter
in interface Bayeux
channels
- A ChannelId
filter
- The filter instance to apply to new channels matching the
patternpublic void removeFilter(String channels, DataFilter filter)
removeFilter
in interface Bayeux
public void addExtension(Extension ext)
public List<Extension> getExtensions()
public void removeExtension(Extension ext)
public ChannelImpl getChannel(ChannelId id)
id
-
public ChannelImpl getChannel(String id)
public Channel getChannel(String id, boolean create)
getChannel
in interface Bayeux
public ChannelId getChannelId(String id)
public Client getClient(String client_id)
getClient
in interface Bayeux
public Set getClientIDs()
public long getMaxInterval()
public int getLogLevel()
public SecurityPolicy getSecurityPolicy()
getSecurityPolicy
in interface Bayeux
public String handle(ClientImpl client, Transport transport, 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 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 Client newClient(String idPrefix, Listener listener)
newClient
in interface Bayeux
public abstract ClientImpl newRemoteClient()
public Transport newTransport(ClientImpl client, Map message)
client
- The clientmessage
- the bayeux message
public void publish(ChannelId to, Client from, Object data, String msgId)
public void publish(Client fromClient, String toChannelId, Object data, String msgId)
Bayeux
publish
in interface Bayeux
fromClient
- The client sending the datatoChannelId
- The Channel ID to which the data is targetteddata
- The data itself which must be an Object that can be encoded with JSON
.msgId
- optional message ID or null for automatic generation of a message ID.public void deliver(Client fromClient, Client toClient, String toChannel, Message message)
Bayeux
deliver
in interface Bayeux
public boolean removeChannel(ChannelId channelId)
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(SecurityPolicy securityPolicy)
setSecurityPolicy
in interface Bayeux
public void subscribe(String toChannel, Client subscriber)
Bayeux
subscribe
in interface Bayeux
public void unsubscribe(String toChannel, Client subscriber)
Bayeux
unsubscribe
in interface Bayeux
public int getMultiFrameInterval()
public void setMultiFrameInterval(int multiFrameInterval)
multiFrameInterval
- the multiFrameInterval to setpublic Object getAdvice()
public void setAdvice(Object advice)
protected void initialize(ServletContext context)
public long getRandom(long variation)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |