org.cometd.bayeux.client.ClientSession
, org.cometd.bayeux.server.LocalSession
, org.cometd.bayeux.Session
public class LocalSessionImpl extends AbstractClientSession implements org.cometd.bayeux.server.LocalSession
A LocalSession
implementation.
This LocalSession
implementation communicates with its
ServerSession
counterpart without any serialization.
Modifier and Type | Class | Description |
---|---|---|
protected class |
LocalSessionImpl.LocalChannel |
A channel scoped to this LocalSession.
|
AbstractClientSession.AbstractSessionChannel
Modifier | Constructor | Description |
---|---|---|
protected |
LocalSessionImpl(BayeuxServerImpl bayeux,
java.lang.String idHint) |
Modifier and Type | Method | Description |
---|---|---|
void |
disconnect(org.cometd.bayeux.client.ClientSession.MessageListener callback) |
|
java.lang.String |
getId() |
|
org.cometd.bayeux.server.ServerSession |
getServerSession() |
|
void |
handshake(java.util.Map<java.lang.String,java.lang.Object> template,
org.cometd.bayeux.client.ClientSession.MessageListener callback) |
|
boolean |
isConnected() |
|
boolean |
isHandshook() |
|
protected AbstractClientSession.AbstractSessionChannel |
newChannel(org.cometd.bayeux.ChannelId channelId) |
|
protected org.cometd.bayeux.ChannelId |
newChannelId(java.lang.String channelId) |
|
protected org.cometd.bayeux.server.ServerMessage.Mutable |
newMessage() |
|
void |
receive(org.cometd.bayeux.Message.Mutable message,
org.cometd.bayeux.Promise<java.lang.Void> promise) |
|
protected void |
send(org.cometd.bayeux.Message.Mutable message) |
|
protected void |
send(ServerSessionImpl session,
org.cometd.bayeux.server.ServerMessage.Mutable message) |
Enqueues or sends a message to the server.
|
protected void |
sendBatch() |
|
java.lang.String |
toString() |
addExtension, batch, dump, dump, endBatch, extendIncoming, extendOutgoing, extendRcv, extendSend, getAttribute, getAttributeNames, getChannel, getChannel, getChannels, getExtensions, isBatching, newMessageId, notifyCallback, notifyListeners, registerCallback, registerSubscriber, remoteCall, removeAttribute, removeExtension, resetSubscriptions, setAttribute, startBatch, unregisterCallback, unregisterSubscriber
addExtension, disconnect, disconnect, getChannel, getExtensions, handshake, handshake, handshake, remoteCall, removeExtension
protected LocalSessionImpl(BayeuxServerImpl bayeux, java.lang.String idHint)
public void receive(org.cometd.bayeux.Message.Mutable message, org.cometd.bayeux.Promise<java.lang.Void> promise)
receive
in class AbstractClientSession
protected AbstractClientSession.AbstractSessionChannel newChannel(org.cometd.bayeux.ChannelId channelId)
newChannel
in class AbstractClientSession
protected org.cometd.bayeux.ChannelId newChannelId(java.lang.String channelId)
newChannelId
in class AbstractClientSession
protected void sendBatch()
sendBatch
in class AbstractClientSession
public org.cometd.bayeux.server.ServerSession getServerSession()
getServerSession
in interface org.cometd.bayeux.server.LocalSession
public void handshake(java.util.Map<java.lang.String,java.lang.Object> template, org.cometd.bayeux.client.ClientSession.MessageListener callback)
handshake
in interface org.cometd.bayeux.client.ClientSession
public void disconnect(org.cometd.bayeux.client.ClientSession.MessageListener callback)
disconnect
in interface org.cometd.bayeux.client.ClientSession
public java.lang.String getId()
getId
in interface org.cometd.bayeux.Session
public boolean isConnected()
isConnected
in interface org.cometd.bayeux.Session
public boolean isHandshook()
isHandshook
in interface org.cometd.bayeux.Session
public java.lang.String toString()
toString
in class java.lang.Object
protected void send(org.cometd.bayeux.Message.Mutable message)
send
in class AbstractClientSession
protected void send(ServerSessionImpl session, org.cometd.bayeux.server.ServerMessage.Mutable message)
Enqueues or sends a message to the server.
This method will either enqueue the message, if this session is batching
,
or perform the send immediately.
session
- The ServerSession to send as. This normally the current server session, but during handshake it is a proposed server session.message
- The message to send.protected org.cometd.bayeux.server.ServerMessage.Mutable newMessage()
newMessage
in class AbstractClientSession
Copyright © 2008–2017 The CometD Project. All rights reserved.