org.cometd.server
Class LocalSessionImpl

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

public class LocalSessionImpl
extends AbstractClientSession
implements LocalSession

A LocalSession implementation.

This session is local to the BayeuxServer instance and communicates with the server without any serialization. The normal Bayeux meta messages are exchanged between the LocalSession and the ServerSession.


Nested Class Summary
protected  class LocalSessionImpl.LocalChannel
          A SessionChannel scoped to this LocalChannel
 
Nested classes/interfaces inherited from class org.cometd.common.AbstractClientSession
AbstractClientSession.AbstractSessionChannel, AbstractClientSession.Handler
 
Nested classes/interfaces inherited from interface org.cometd.bayeux.client.ClientSession
ClientSession.Extension
 
Field Summary
 
Fields inherited from class org.cometd.common.AbstractClientSession
_attributes, _batch, _channels, _extensions, _idGen, _wild
 
Constructor Summary
protected LocalSessionImpl(BayeuxServerImpl bayeux, java.lang.String idHint)
           
 
Method Summary
 void disconnect()
           
protected  void doDisconnected()
           
protected  void doSend(ServerSessionImpl session, ServerMessage.Mutable message)
          Send a message (to the server).
protected  void dump(java.lang.StringBuilder b, java.lang.String indent)
           
 java.lang.String getId()
           
 ServerSession getServerSession()
           
 void handshake()
           
 void handshake(java.util.Map<java.lang.String,java.lang.Object> template)
           
 boolean isConnected()
           
protected  AbstractClientSession.AbstractSessionChannel newChannel(ChannelId channelId)
           
protected  ChannelId newChannelId(java.lang.String channelId)
           
protected  void send(ServerSessionImpl session, ServerMessage.Mutable message)
          Send a message (to the server).
protected  void sendBatch()
           
 java.lang.String toString()
           
 
Methods inherited from class org.cometd.common.AbstractClientSession
addExtension, batch, endBatch, getAttribute, getAttributeNames, getChannel, receive, removeAttribute, setAttribute, startBatch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.cometd.bayeux.client.ClientSession
addExtension, getChannel
 
Methods inherited from interface org.cometd.bayeux.Session
batch, endBatch, getAttribute, getAttributeNames, removeAttribute, setAttribute, startBatch
 

Constructor Detail

LocalSessionImpl

protected LocalSessionImpl(BayeuxServerImpl bayeux,
                           java.lang.String idHint)
Method Detail

doDisconnected

protected void doDisconnected()
Specified by:
doDisconnected in class AbstractClientSession
See Also:
AbstractClientSession.doDisconnected()

newChannel

protected AbstractClientSession.AbstractSessionChannel newChannel(ChannelId channelId)
Specified by:
newChannel in class AbstractClientSession
See Also:
AbstractClientSession.newChannel(org.cometd.common.ChannelId)

newChannelId

protected ChannelId newChannelId(java.lang.String channelId)
Specified by:
newChannelId in class AbstractClientSession
See Also:
AbstractClientSession.newChannelId(java.lang.String)

sendBatch

protected void sendBatch()
Specified by:
sendBatch in class AbstractClientSession
See Also:
AbstractClientSession.sendBatch()

getServerSession

public ServerSession getServerSession()
Specified by:
getServerSession in interface LocalSession

handshake

public void handshake()
Specified by:
handshake in interface ClientSession

handshake

public void handshake(java.util.Map<java.lang.String,java.lang.Object> template)
Specified by:
handshake in interface ClientSession

disconnect

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

getId

public java.lang.String getId()
Specified by:
getId in interface Session

isConnected

public boolean isConnected()
Specified by:
isConnected in interface Session

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

send

protected void send(ServerSessionImpl session,
                    ServerMessage.Mutable message)
Send a message (to the server).

This method will either batch the message or call doSend(ServerSessionImpl, org.cometd.bayeux.server.ServerMessage.Mutable)

Parameters:
session - The ServerSession to send as. This normally the current server session, but during handshake it is a proposed server session.
message - The message to send.

doSend

protected void doSend(ServerSessionImpl session,
                      ServerMessage.Mutable message)
Send a message (to the server).

Extends and sends the message without batching.

Parameters:
session - The ServerSession to send as. This normally the current server session, but during handshake it is a proposed server session.
message - The message to send.

dump

protected void dump(java.lang.StringBuilder b,
                    java.lang.String indent)


Copyright © 2010 Dojo Foundation. All Rights Reserved.