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 class
AbstractClientSession.AbstractSessionChannel
A 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 protected
AbstractClientSession()
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.cometd.bayeux.client.ClientSession
disconnect, handshake, handshake, handshake
Methods inherited from interface org.cometd.bayeux.Session
disconnect, getId, isConnected, isHandshook
-
Constructor Details
-
AbstractClientSession
protected AbstractClientSession()
-
-
Method Details
-
newMessageId
-
addExtension
- Specified by:
addExtension
in interfaceClientSession
-
removeExtension
- Specified by:
removeExtension
in interfaceClientSession
-
getExtensions
- Specified by:
getExtensions
in interfaceClientSession
-
extendSend
-
extendRcv
-
newChannelId
-
newChannel
-
getChannel
- Specified by:
getChannel
in interfaceClientSession
-
getChannel
-
getChannels
-
startBatch
public void startBatch()- Specified by:
startBatch
in interfaceSession
-
sendBatch
protected abstract void sendBatch() -
endBatch
public boolean endBatch() -
batch
-
isBatching
protected boolean isBatching() -
getAttribute
- Specified by:
getAttribute
in interfaceSession
-
getAttributeNames
- Specified by:
getAttributeNames
in interfaceSession
-
removeAttribute
- Specified by:
removeAttribute
in interfaceSession
-
setAttribute
- Specified by:
setAttribute
in interfaceSession
-
remoteCall
- Specified by:
remoteCall
in interfaceClientSession
-
send
-
newMessage
-
resetSubscriptions
protected void resetSubscriptions() -
receive
Receives a message (from the server) and process it.
Processing the message involves calling the receive
extensions
and 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:
dump
in interfaceorg.eclipse.jetty.util.component.Dumpable
-
dump
- Specified by:
dump
in interfaceorg.eclipse.jetty.util.component.Dumpable
- Throws:
IOException
-