public class LocalSessionImpl extends AbstractClientSession implements LocalSession
A LocalSession
implementation.
This LocalSession
implementation communicates with its
ServerSession
counterpart without any serialization.
Modifier and Type | Class and Description |
---|---|
protected class |
LocalSessionImpl.LocalChannel
A channel scoped to this LocalSession.
|
AbstractClientSession.AbstractSessionChannel
ClientSession.Extension, ClientSession.MessageListener
Modifier | Constructor and Description |
---|---|
protected |
LocalSessionImpl(BayeuxServerImpl bayeux,
String idHint) |
Modifier and Type | Method and Description |
---|---|
void |
disconnect() |
void |
disconnect(ClientSessionChannel.MessageListener callback) |
protected void |
doSend(ServerSessionImpl from,
ServerMessage.Mutable message)
Sends a message to the server.
|
String |
getId() |
ServerSession |
getServerSession() |
void |
handshake() |
void |
handshake(Map<String,Object> template) |
void |
handshake(Map<String,Object> template,
ClientSessionChannel.MessageListener callback) |
boolean |
isConnected() |
boolean |
isHandshook() |
protected AbstractClientSession.AbstractSessionChannel |
newChannel(ChannelId channelId) |
protected ChannelId |
newChannelId(String channelId) |
protected ServerMessage.Mutable |
newMessage() |
void |
receive(Message.Mutable message) |
protected void |
send(Message.Mutable message) |
protected void |
send(ServerSessionImpl session,
ServerMessage.Mutable message)
Enqueues or sends a message to the server.
|
protected void |
sendBatch() |
String |
toString() |
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addExtension, getChannel, getExtensions, remoteCall, removeExtension
batch, endBatch, getAttribute, getAttributeNames, removeAttribute, setAttribute, startBatch
protected LocalSessionImpl(BayeuxServerImpl bayeux, String idHint)
public void receive(Message.Mutable message)
receive
in class AbstractClientSession
protected AbstractClientSession.AbstractSessionChannel newChannel(ChannelId channelId)
newChannel
in class AbstractClientSession
protected ChannelId newChannelId(String channelId)
newChannelId
in class AbstractClientSession
protected void sendBatch()
sendBatch
in class AbstractClientSession
public ServerSession getServerSession()
getServerSession
in interface LocalSession
public void handshake()
handshake
in interface ClientSession
public void handshake(Map<String,Object> template)
handshake
in interface ClientSession
public void handshake(Map<String,Object> template, ClientSessionChannel.MessageListener callback)
handshake
in interface ClientSession
public void disconnect()
disconnect
in interface Session
public void disconnect(ClientSessionChannel.MessageListener callback)
disconnect
in interface ClientSession
public boolean isConnected()
isConnected
in interface Session
public boolean isHandshook()
isHandshook
in interface Session
protected void send(Message.Mutable message)
send
in class AbstractClientSession
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 actual send by calling doSend(ServerSessionImpl, ServerMessage.Mutable)
.
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 void doSend(ServerSessionImpl from, ServerMessage.Mutable message)
Sends a message to the server.
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.protected ServerMessage.Mutable newMessage()
newMessage
in class AbstractClientSession
Copyright © 2008–2016 The CometD Project. All rights reserved.