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
public class LocalSessionImpl extends AbstractClientSession implements LocalSession
A
LocalSessionimplementation.This
LocalSessionimplementation communicates with itsServerSessioncounterpart without any serialization.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classLocalSessionImpl.LocalChannelA channel scoped to this LocalSession.-
Nested classes/interfaces inherited from class org.cometd.common.AbstractClientSession
AbstractClientSession.AbstractSessionChannel
-
-
Constructor Summary
Constructors Constructor Description LocalSessionImpl(BayeuxServerImpl bayeux, java.lang.String idHint)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisconnect(org.cometd.bayeux.client.ClientSession.MessageListener callback)java.lang.StringgetId()ServerSessiongetServerSession()voidhandshake(java.util.Map<java.lang.String,java.lang.Object> template, org.cometd.bayeux.client.ClientSession.MessageListener callback)booleanisConnected()booleanisHandshook()protected AbstractClientSession.AbstractSessionChannelnewChannel(org.cometd.bayeux.ChannelId channelId)protected org.cometd.bayeux.ChannelIdnewChannelId(java.lang.String channelId)protected ServerMessage.MutablenewMessage()voidreceive(org.cometd.bayeux.Message.Mutable message, org.cometd.bayeux.Promise<java.lang.Void> promise)protected voidsend(org.cometd.bayeux.Message.Mutable message)protected voidsend(ServerSessionImpl session, ServerMessage.Mutable message)Enqueues or sends a message to the server.protected voidsendBatch()java.lang.StringtoString()-
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
-
-
-
-
Constructor Detail
-
LocalSessionImpl
public LocalSessionImpl(BayeuxServerImpl bayeux, java.lang.String idHint)
-
-
Method Detail
-
receive
public void receive(org.cometd.bayeux.Message.Mutable message, org.cometd.bayeux.Promise<java.lang.Void> promise)- Overrides:
receivein classAbstractClientSession
-
newChannel
protected AbstractClientSession.AbstractSessionChannel newChannel(org.cometd.bayeux.ChannelId channelId)
- Specified by:
newChannelin classAbstractClientSession
-
newChannelId
protected org.cometd.bayeux.ChannelId newChannelId(java.lang.String channelId)
- Specified by:
newChannelIdin classAbstractClientSession
-
sendBatch
protected void sendBatch()
- Specified by:
sendBatchin classAbstractClientSession
-
getServerSession
public ServerSession getServerSession()
- Specified by:
getServerSessionin interfaceLocalSession
-
handshake
public void handshake(java.util.Map<java.lang.String,java.lang.Object> template, org.cometd.bayeux.client.ClientSession.MessageListener callback)- Specified by:
handshakein interfaceorg.cometd.bayeux.client.ClientSession
-
disconnect
public void disconnect(org.cometd.bayeux.client.ClientSession.MessageListener callback)
- Specified by:
disconnectin interfaceorg.cometd.bayeux.client.ClientSession
-
getId
public java.lang.String 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
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
send
protected void send(org.cometd.bayeux.Message.Mutable message)
- Specified by:
sendin classAbstractClientSession
-
send
protected void send(ServerSessionImpl session, 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 ServerMessage.Mutable newMessage()
- Overrides:
newMessagein classAbstractClientSession
-
-