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 org.slf4j.Logger |
logger |
protected static String |
PUBLISH_CALLBACK_KEY |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractClientSession() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithandshake, handshakedisconnect, getId, isConnected, isHandshookprotected static final String PUBLISH_CALLBACK_KEY
protected static final org.slf4j.Logger logger
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 channelId)
getChannel in interface ClientSessionprotected 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)
public void dump(StringBuilder b, String indent)
Copyright © 2008-2012 Dojo Foundation. All Rights Reserved.