public abstract class AbstractClientSession extends Object implements ClientSession
Partial implementation of ClientSession.
It handles extensions and batching, and provides utility methods to be used by subclasses.
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractClientSession.AbstractSessionChannel
A channel scoped to a
ClientSession. |
ClientSession.Extension| Modifier and Type | Field and Description |
|---|---|
protected static String |
CALLBACK_KEY |
protected static String |
SUBSCRIBER_KEY |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractClientSession() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdisconnect, handshake, handshake, handshakedisconnect, getId, isConnected, isHandshookprotected static final String SUBSCRIBER_KEY
protected static final String CALLBACK_KEY
protected String newMessageId()
public void addExtension(ClientSession.Extension extension)
addExtension in interface ClientSessionpublic void removeExtension(ClientSession.Extension extension)
removeExtension in interface ClientSessionpublic List<ClientSession.Extension> getExtensions()
getExtensions in interface ClientSessionprotected boolean extendSend(Message.Mutable message)
protected boolean extendRcv(Message.Mutable message)
protected abstract AbstractClientSession.AbstractSessionChannel newChannel(ChannelId channelId)
public ClientSessionChannel getChannel(String channelName)
getChannel in interface ClientSessionpublic ClientSessionChannel getChannel(ChannelId channelId)
protected ConcurrentMap<String,AbstractClientSession.AbstractSessionChannel> getChannels()
public void startBatch()
startBatch in interface Sessionprotected abstract void sendBatch()
protected boolean isBatching()
public Object getAttribute(String name)
getAttribute in interface Sessionpublic Set<String> getAttributeNames()
getAttributeNames in interface Sessionpublic Object removeAttribute(String name)
removeAttribute in interface Sessionpublic void setAttribute(String name, Object value)
setAttribute in interface Sessionprotected void resetSubscriptions()
public void receive(Message.Mutable message)
Receives a message (from the server) and process it.
Processing the message involves calling the receive extensions
and the channel listeners.
message - the message received.protected void notifyListeners(Message.Mutable message)
protected void notifyListener(ClientSessionChannel.MessageListener listener, Message.Mutable message)
protected void registerCallback(String messageId, ClientSessionChannel.MessageListener callback)
protected ClientSessionChannel.MessageListener unregisterCallback(String messageId)
protected void registerSubscriber(String messageId, ClientSessionChannel.MessageListener subscriber)
protected ClientSessionChannel.MessageListener unregisterSubscriber(String messageId)
public void dump(StringBuilder b, String indent)
Copyright © 2008–2016 Dojo Foundation. All rights reserved.