org.cometd.common
Class AbstractClientSession

java.lang.Object
  extended by org.cometd.common.AbstractClientSession
All Implemented Interfaces:
ClientSession, Session

public abstract class AbstractClientSession
extends java.lang.Object
implements ClientSession


Nested Class Summary
protected static class AbstractClientSession.AbstractSessionChannel
          A SessionChannel scoped to this LocalChannel
protected static interface AbstractClientSession.Handler
           
 
Nested classes/interfaces inherited from interface org.cometd.bayeux.client.ClientSession
ClientSession.Extension
 
Field Summary
protected  org.eclipse.jetty.util.AttributesMap _attributes
           
protected  java.util.concurrent.atomic.AtomicInteger _batch
           
protected  java.util.concurrent.ConcurrentMap<java.lang.String,AbstractClientSession.AbstractSessionChannel> _channels
           
protected  java.util.List<ClientSession.Extension> _extensions
           
protected  java.util.concurrent.atomic.AtomicInteger _idGen
           
protected  java.util.List<AbstractClientSession.AbstractSessionChannel> _wild
           
 
Constructor Summary
protected AbstractClientSession()
           
 
Method Summary
 void addExtension(ClientSession.Extension extension)
           
 void batch(java.lang.Runnable batch)
           
protected abstract  void doDisconnected()
           
 void endBatch()
           
 java.lang.Object getAttribute(java.lang.String name)
           
 java.util.Set<java.lang.String> getAttributeNames()
           
 SessionChannel getChannel(java.lang.String channelId)
           
protected abstract  AbstractClientSession.AbstractSessionChannel newChannel(ChannelId channelId)
           
protected abstract  ChannelId newChannelId(java.lang.String channelId)
           
 void receive(Message message, Message.Mutable mutable)
          Receive a message (from the server)
 java.lang.Object removeAttribute(java.lang.String name)
           
protected abstract  void sendBatch()
           
 void setAttribute(java.lang.String name, java.lang.Object value)
           
 void startBatch()
           
 
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
handshake, handshake
 
Methods inherited from interface org.cometd.bayeux.Session
disconnect, getId, isConnected
 

Field Detail

_extensions

protected final java.util.List<ClientSession.Extension> _extensions

_attributes

protected final org.eclipse.jetty.util.AttributesMap _attributes

_channels

protected final java.util.concurrent.ConcurrentMap<java.lang.String,AbstractClientSession.AbstractSessionChannel> _channels

_batch

protected final java.util.concurrent.atomic.AtomicInteger _batch

_wild

protected final java.util.List<AbstractClientSession.AbstractSessionChannel> _wild

_idGen

protected final java.util.concurrent.atomic.AtomicInteger _idGen
Constructor Detail

AbstractClientSession

protected AbstractClientSession()
Method Detail

addExtension

public void addExtension(ClientSession.Extension extension)
Specified by:
addExtension in interface ClientSession

newChannelId

protected abstract ChannelId newChannelId(java.lang.String channelId)

newChannel

protected abstract AbstractClientSession.AbstractSessionChannel newChannel(ChannelId channelId)

getChannel

public SessionChannel getChannel(java.lang.String channelId)
Specified by:
getChannel in interface ClientSession

startBatch

public void startBatch()
Specified by:
startBatch in interface Session

sendBatch

protected abstract void sendBatch()

endBatch

public void endBatch()
Specified by:
endBatch in interface Session

batch

public void batch(java.lang.Runnable batch)
Specified by:
batch in interface Session

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Specified by:
getAttribute in interface Session

getAttributeNames

public java.util.Set<java.lang.String> getAttributeNames()
Specified by:
getAttributeNames in interface Session

removeAttribute

public java.lang.Object removeAttribute(java.lang.String name)
Specified by:
removeAttribute in interface Session

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Specified by:
setAttribute in interface Session

receive

public void receive(Message message,
                    Message.Mutable mutable)
Receive a message (from the server)

This method calls the receive extensions, the ClientSessionListeners and then the subscribed MessageListeners.

Parameters:
message - the message to receive.

doDisconnected

protected abstract void doDisconnected()


Copyright © 2010 Dojo Foundation. All Rights Reserved.