Package org.cometd.common
Class AbstractClientSession
java.lang.Object
org.cometd.common.AbstractClientSession
- All Implemented Interfaces:
ClientSession,Session,org.eclipse.jetty.util.component.Dumpable
public abstract class AbstractClientSession extends Object implements ClientSession, org.eclipse.jetty.util.component.Dumpable
Partial implementation of ClientSession.
It handles extensions and batching, and provides utility methods to be used by subclasses.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classAbstractClientSession.AbstractSessionChannelA channel scoped to aClientSession.Nested classes/interfaces inherited from interface org.cometd.bayeux.client.ClientSession
ClientSession.Extension, ClientSession.MessageListener -
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractClientSession() -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cometd.bayeux.client.ClientSession
disconnect, handshake, handshake, handshakeMethods inherited from interface org.cometd.bayeux.Session
disconnect, getId, isConnected, isHandshook
-
Constructor Details
-
AbstractClientSession
protected AbstractClientSession()
-
-
Method Details
-
newMessageId
-
addExtension
- Specified by:
addExtensionin interfaceClientSession
-
removeExtension
- Specified by:
removeExtensionin interfaceClientSession
-
getExtensions
- Specified by:
getExtensionsin interfaceClientSession
-
extendSend
-
extendRcv
-
newChannelId
-
newChannel
-
getChannel
- Specified by:
getChannelin interfaceClientSession
-
getChannel
-
getChannels
-
startBatch
public void startBatch()- Specified by:
startBatchin interfaceSession
-
sendBatch
protected abstract void sendBatch() -
endBatch
public boolean endBatch() -
batch
-
isBatching
protected boolean isBatching() -
getAttribute
- Specified by:
getAttributein interfaceSession
-
getAttributeNames
- Specified by:
getAttributeNamesin interfaceSession
-
removeAttribute
- Specified by:
removeAttributein interfaceSession
-
setAttribute
- Specified by:
setAttributein interfaceSession
-
remoteCall
- Specified by:
remoteCallin interfaceClientSession
-
send
-
newMessage
-
resetSubscriptions
protected void resetSubscriptions() -
receive
Receives a message (from the server) and process it.
Processing the message involves calling the receive
extensionsand the channellisteners.- Parameters:
message- the message received.
-
notifyListeners
-
notifyListener
protected void notifyListener(ClientSessionChannel.MessageListener listener, Message.Mutable message) -
registerCallback
-
unregisterCallback
-
registerSubscriber
protected void registerSubscriber(String messageId, ClientSessionChannel.MessageListener subscriber) -
unregisterSubscriber
-
dump
- Specified by:
dumpin interfaceorg.eclipse.jetty.util.component.Dumpable
-
dump
- Specified by:
dumpin interfaceorg.eclipse.jetty.util.component.Dumpable- Throws:
IOException
-