Package org.cometd.server
Class LocalSessionImpl
java.lang.Object
org.cometd.common.AbstractClientSession
org.cometd.server.LocalSessionImpl
- All Implemented Interfaces:
org.cometd.bayeux.client.ClientSession
,LocalSession
,org.cometd.bayeux.Session
,org.eclipse.jetty.util.component.Dumpable
A LocalSession
implementation.
This LocalSession
implementation communicates with its
ServerSession
counterpart without any serialization.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
A channel scoped to this LocalSession.Nested classes/interfaces inherited from class org.cometd.common.AbstractClientSession
AbstractClientSession.AbstractSessionChannel
Nested classes/interfaces inherited from interface org.cometd.bayeux.client.ClientSession
org.cometd.bayeux.client.ClientSession.Extension, org.cometd.bayeux.client.ClientSession.MessageListener
Nested 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 TypeMethodDescriptionvoid
disconnect
(org.cometd.bayeux.client.ClientSession.MessageListener callback) getId()
void
handshake
(Map<String, Object> template, org.cometd.bayeux.client.ClientSession.MessageListener callback) boolean
boolean
newChannel
(org.cometd.bayeux.ChannelId channelId) protected org.cometd.bayeux.ChannelId
newChannelId
(String channelId) protected ServerMessage.Mutable
void
protected void
send
(org.cometd.bayeux.Message.Mutable message) protected void
send
(ServerSessionImpl session, ServerMessage.Mutable message) Enqueues or sends a message to the server.protected void
toString()
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, unregisterSubscriber
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.cometd.bayeux.client.ClientSession
addExtension, disconnect, getChannel, getExtensions, handshake, handshake, remoteCall, removeExtension
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable
dump, dumpSelf
Methods 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:
receive
in classAbstractClientSession
-
newChannel
protected AbstractClientSession.AbstractSessionChannel newChannel(org.cometd.bayeux.ChannelId channelId) - Specified by:
newChannel
in classAbstractClientSession
-
newChannelId
- Specified by:
newChannelId
in classAbstractClientSession
-
sendBatch
protected void sendBatch()- Specified by:
sendBatch
in classAbstractClientSession
-
getServerSession
- Specified by:
getServerSession
in interfaceLocalSession
-
handshake
public void handshake(Map<String, Object> template, org.cometd.bayeux.client.ClientSession.MessageListener callback) - Specified by:
handshake
in interfaceorg.cometd.bayeux.client.ClientSession
-
disconnect
public void disconnect(org.cometd.bayeux.client.ClientSession.MessageListener callback) - Specified by:
disconnect
in interfaceorg.cometd.bayeux.client.ClientSession
-
getId
- Specified by:
getId
in interfaceorg.cometd.bayeux.Session
-
isConnected
public boolean isConnected()- Specified by:
isConnected
in interfaceorg.cometd.bayeux.Session
-
isHandshook
public boolean isHandshook()- Specified by:
isHandshook
in interfaceorg.cometd.bayeux.Session
-
toString
-
send
protected void send(org.cometd.bayeux.Message.Mutable message) - Specified by:
send
in classAbstractClientSession
-
send
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
- Overrides:
newMessage
in classAbstractClientSession
-