Class LocalSessionImpl
java.lang.Object
org.cometd.common.AbstractClientSession
org.cometd.server.LocalSessionImpl
- All Implemented Interfaces:
org.cometd.bayeux.client.ClientSession, org.cometd.bayeux.server.LocalSession, org.cometd.bayeux.Session, org.eclipse.jetty.util.component.Dumpable
public class LocalSessionImpl
extends org.cometd.common.AbstractClientSession
implements org.cometd.bayeux.server.LocalSession
A LocalSession implementation.
This LocalSession implementation communicates with its
ServerSession counterpart without any serialization.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classA channel scoped to this LocalSession.Nested classes/interfaces inherited from class org.cometd.common.AbstractClientSession
org.cometd.common.AbstractClientSession.AbstractSessionChannelNested classes/interfaces inherited from interface org.cometd.bayeux.client.ClientSession
org.cometd.bayeux.client.ClientSession.Extension, org.cometd.bayeux.client.ClientSession.MessageListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainer -
Field Summary
Fields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddisconnect(org.cometd.bayeux.client.ClientSession.MessageListener callback) getId()org.cometd.bayeux.server.ServerSessionvoidhandshake(Map<String, Object> template, org.cometd.bayeux.client.ClientSession.MessageListener callback) booleanbooleanprotected org.cometd.common.AbstractClientSession.AbstractSessionChannelnewChannel(org.cometd.bayeux.ChannelId channelId) protected org.cometd.bayeux.ChannelIdnewChannelId(String channelId) protected org.cometd.bayeux.server.ServerMessage.Mutablevoidprotected voidsend(org.cometd.bayeux.Message.Mutable message) protected voidsend(ServerSessionImpl session, org.cometd.bayeux.server.ServerMessage.Mutable message) Enqueues or sends a message to the server.protected voidtoString()Methods inherited from class org.cometd.common.AbstractClientSession
addExtension, batch, dump, endBatch, extendIncoming, extendOutgoing, getAttribute, getAttributeNames, getChannel, getChannel, getChannels, getExtensions, isBatching, newMessageId, notifyCallback, notifyListeners, registerCallback, registerSubscriber, remoteCall, removeAttribute, removeExtension, resetSubscriptions, setAttribute, startBatch, unregisterCallback, unregisterSubscriberMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.cometd.bayeux.client.ClientSession
addExtension, disconnect, getChannel, getExtensions, handshake, handshake, remoteCall, removeExtensionMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dump, dumpSelfMethods inherited from interface org.cometd.bayeux.Session
batch, endBatch, getAttribute, getAttributeNames, removeAttribute, setAttribute, startBatch
-
Constructor Details
-
LocalSessionImpl
-
-
Method Details
-
receive
public void receive(org.cometd.bayeux.Message.Mutable message, org.cometd.bayeux.Promise<Void> promise) - Overrides:
receivein classorg.cometd.common.AbstractClientSession
-
newChannel
protected org.cometd.common.AbstractClientSession.AbstractSessionChannel newChannel(org.cometd.bayeux.ChannelId channelId) - Specified by:
newChannelin classorg.cometd.common.AbstractClientSession
-
newChannelId
- Specified by:
newChannelIdin classorg.cometd.common.AbstractClientSession
-
sendBatch
protected void sendBatch()- Specified by:
sendBatchin classorg.cometd.common.AbstractClientSession
-
getServerSession
public org.cometd.bayeux.server.ServerSession getServerSession()- Specified by:
getServerSessionin interfaceorg.cometd.bayeux.server.LocalSession
-
handshake
-
disconnect
public void disconnect(org.cometd.bayeux.client.ClientSession.MessageListener callback) - Specified by:
disconnectin interfaceorg.cometd.bayeux.client.ClientSession
-
getId
- Specified by:
getIdin interfaceorg.cometd.bayeux.Session
-
isConnected
public boolean isConnected()- Specified by:
isConnectedin interfaceorg.cometd.bayeux.Session
-
isHandshook
public boolean isHandshook()- Specified by:
isHandshookin interfaceorg.cometd.bayeux.Session
-
toString
-
send
protected void send(org.cometd.bayeux.Message.Mutable message) - Specified by:
sendin classorg.cometd.common.AbstractClientSession
-
send
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.- Parameters:
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.
-
newMessage
protected org.cometd.bayeux.server.ServerMessage.Mutable newMessage()- Overrides:
newMessagein classorg.cometd.common.AbstractClientSession
-