|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ServerSession
Bayeux Server Session.
This interface represents the server-side of a bayeux session.
The server side of a bayeux session contains the queue of messages
to be delivered to the client side of the session. Messages are
normally queued on a server session by being published to a
channel to which the session is subscribed, however the deliver(Session, ServerMessage)
and deliver(Session, String, Object, Object)
methods may
be used to directly queue messages to a session without
publishing them to all subscribers for a channel.
Nested Class Summary | |
---|---|
static interface |
ServerSession.DeQueueListener
|
static interface |
ServerSession.Extension
|
static interface |
ServerSession.MaxQueueListener
|
static interface |
ServerSession.MessageListener
Queue a message listener |
static interface |
ServerSession.RemoveListener
Queue a message listener |
static interface |
ServerSession.ServerSessionListener
|
Method Summary | |
---|---|
void |
addExtension(ServerSession.Extension extension)
Add and extension to this session. |
void |
addListener(ServerSession.ServerSessionListener listener)
|
void |
deliver(Session from,
ServerMessage msg)
Deliver the message to the session listeners and queue. |
void |
deliver(Session from,
java.lang.String channel,
java.lang.Object data,
java.lang.Object id)
Deliver the message to the session listeners and queue. |
void |
disconnect()
Disconnect this session. |
LocalSession |
getLocalSession()
Get the local session. |
java.util.Queue<ServerMessage> |
getQueue()
Get the session message queue. |
boolean |
isLocalSession()
|
void |
removeListener(ServerSession.ServerSessionListener listener)
|
Methods inherited from interface org.cometd.bayeux.Session |
---|
batch, endBatch, getAttribute, getAttributeNames, getId, isConnected, removeAttribute, setAttribute, startBatch |
Method Detail |
---|
void addExtension(ServerSession.Extension extension)
extension
- void addListener(ServerSession.ServerSessionListener listener)
listener
- void removeListener(ServerSession.ServerSessionListener listener)
listener
- boolean isLocalSession()
LocalSession getLocalSession()
java.util.Queue<ServerMessage> getQueue()
void deliver(Session from, ServerMessage msg)
This is different to a SessionChannel.publish(Object)
call, as the message is delivered only to this client and
not to all subscribers to the channel. The message should still
have a channel id specified, so that the ClientSession may
identify which handler the message should be delivered to.
from
- msg
- void deliver(Session from, java.lang.String channel, java.lang.Object data, java.lang.Object id)
This is different to a SessionChannel.publish(Object)
call, as the message is delivered only to this client and
not to all subscribers to the channel. The message should still
have a channel id specified, so that the ClientSession may
identify which handler the message should be delivered to.
void disconnect()
disconnect
in interface Session
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |