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,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.LocalSessionA
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.
-
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()voiddisconnect(org.cometd.bayeux.client.ClientSessionChannel.MessageListener callback)protected voiddoSend(ServerSessionImpl from, org.cometd.bayeux.server.ServerMessage.Mutable message)Sends a message to the server.java.lang.StringgetId()org.cometd.bayeux.server.ServerSessiongetServerSession()voidhandshake()voidhandshake(java.util.Map<java.lang.String,java.lang.Object> template)voidhandshake(java.util.Map<java.lang.String,java.lang.Object> template, org.cometd.bayeux.client.ClientSessionChannel.MessageListener callback)booleanisConnected()booleanisHandshook()protected org.cometd.common.AbstractClientSession.AbstractSessionChannelnewChannel(org.cometd.bayeux.ChannelId channelId)protected org.cometd.bayeux.ChannelIdnewChannelId(java.lang.String channelId)protected org.cometd.bayeux.server.ServerMessage.MutablenewMessage()voidreceive(org.cometd.bayeux.Message.Mutable message)protected 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 voidsendBatch()java.lang.StringtoString()-
Methods inherited from class org.cometd.common.AbstractClientSession
addExtension, batch, dump, dump, endBatch, extendRcv, extendSend, getAttribute, getAttributeNames, getChannel, getChannel, getChannels, getExtensions, isBatching, newMessageId, notifyListener, 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)
- 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
protected org.cometd.bayeux.ChannelId newChannelId(java.lang.String channelId)
- 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
public void handshake()
- Specified by:
handshakein interfaceorg.cometd.bayeux.client.ClientSession
-
handshake
public void handshake(java.util.Map<java.lang.String,java.lang.Object> template)
- Specified by:
handshakein interfaceorg.cometd.bayeux.client.ClientSession
-
handshake
public void handshake(java.util.Map<java.lang.String,java.lang.Object> template, org.cometd.bayeux.client.ClientSessionChannel.MessageListener callback)- Specified by:
handshakein interfaceorg.cometd.bayeux.client.ClientSession
-
disconnect
public void disconnect()
- Specified by:
disconnectin interfaceorg.cometd.bayeux.Session
-
disconnect
public void disconnect(org.cometd.bayeux.client.ClientSessionChannel.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 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 actual send by callingdoSend(ServerSessionImpl, ServerMessage.Mutable).- 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.
-
doSend
protected void doSend(ServerSessionImpl from, org.cometd.bayeux.server.ServerMessage.Mutable message)
Sends a message to the server.
- Parameters:
from- 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
-
-