org.cometd.common
Class AbstractClientSession
java.lang.Object
org.cometd.common.AbstractClientSession
- All Implemented Interfaces:
- ClientSession, Session
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.
|
Field Summary |
protected static org.slf4j.Logger |
logger
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected static final org.slf4j.Logger logger
AbstractClientSession
protected AbstractClientSession()
newMessageId
protected String newMessageId()
addExtension
public void addExtension(ClientSession.Extension extension)
- Specified by:
addExtension in interface ClientSession
removeExtension
public void removeExtension(ClientSession.Extension extension)
- Specified by:
removeExtension in interface ClientSession
extendSend
protected boolean extendSend(Message.Mutable message)
extendRcv
protected boolean extendRcv(Message.Mutable message)
newChannelId
protected abstract ChannelId newChannelId(String channelId)
newChannel
protected abstract AbstractClientSession.AbstractSessionChannel newChannel(ChannelId channelId)
getChannel
public ClientSessionChannel getChannel(String channelId)
- Specified by:
getChannel in interface ClientSession
getChannels
protected ConcurrentMap<String,AbstractClientSession.AbstractSessionChannel> getChannels()
startBatch
public void startBatch()
- Specified by:
startBatch in interface Session
sendBatch
protected abstract void sendBatch()
endBatch
public boolean endBatch()
- Specified by:
endBatch in interface Session
batch
public void batch(Runnable batch)
- Specified by:
batch in interface Session
isBatching
protected boolean isBatching()
getAttribute
public Object getAttribute(String name)
- Specified by:
getAttribute in interface Session
getAttributeNames
public Set<String> getAttributeNames()
- Specified by:
getAttributeNames in interface Session
removeAttribute
public Object removeAttribute(String name)
- Specified by:
removeAttribute in interface Session
setAttribute
public void setAttribute(String name,
Object value)
- Specified by:
setAttribute in interface Session
resetSubscriptions
protected void resetSubscriptions()
receive
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.
- Parameters:
message - the message received.
dump
public void dump(StringBuilder b,
String indent)
Copyright © 2008-2011 Dojo Foundation. All Rights Reserved.