Class LocalSessionImpl

java.lang.Object
org.cometd.common.AbstractClientSession
org.cometd.server.LocalSessionImpl
All Implemented Interfaces:
org.cometd.bayeux.client.ClientSession, org.cometd.bayeux.server.LocalSession, org.cometd.bayeux.Session, org.eclipse.jetty.util.component.Dumpable

public class LocalSessionImpl extends org.cometd.common.AbstractClientSession implements org.cometd.bayeux.server.LocalSession

A LocalSession implementation.

This LocalSession implementation communicates with its ServerSession counterpart without any serialization.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected class 
    A channel scoped to this LocalSession.

    Nested classes/interfaces inherited from class org.cometd.common.AbstractClientSession

    org.cometd.common.AbstractClientSession.AbstractSessionChannel

    Nested classes/interfaces inherited from interface org.cometd.bayeux.client.ClientSession

    org.cometd.bayeux.client.ClientSession.Extension, org.cometd.bayeux.client.ClientSession.MessageListener

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable

    org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.Dumpable.DumpAppendable
  • Field Summary

    Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

    LEGEND
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    disconnect(org.cometd.bayeux.client.ClientSession.MessageListener callback)
     
     
    org.cometd.bayeux.server.ServerSession
     
    void
    handshake(Map<String,Object> template, org.cometd.bayeux.client.ClientSession.MessageListener callback)
     
    boolean
     
    boolean
     
    protected org.cometd.common.AbstractClientSession.AbstractSessionChannel
    newChannel(org.cometd.bayeux.ChannelId channelId)
     
    protected org.cometd.bayeux.ChannelId
    newChannelId(String channelId)
     
    protected org.cometd.bayeux.server.ServerMessage.Mutable
     
    void
    receive(org.cometd.bayeux.Message.Mutable message, org.cometd.bayeux.Promise<Void> promise)
     
    protected void
    send(org.cometd.bayeux.Message.Mutable message)
     
    protected void
    send(ServerSessionImpl session, org.cometd.bayeux.server.ServerMessage.Mutable message)
    Enqueues or sends a message to the server.
    protected void
     
     

    Methods inherited from class org.cometd.common.AbstractClientSession

    addExtension, batch, dump, endBatch, extendIncoming, extendOutgoing, getAttribute, getAttributeNames, getChannel, getChannel, getChannels, getExtensions, isBatching, newMessageId, notifyCallback, notifyListeners, registerCallback, registerSubscriber, remoteCall, removeAttribute, removeExtension, resetSubscriptions, setAttribute, startBatch, unregisterCallback, unregisterSubscriber

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.cometd.bayeux.client.ClientSession

    addExtension, disconnect, getChannel, getExtensions, handshake, handshake, remoteCall, removeExtension

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable

    dump, dumpSelf

    Methods inherited from interface org.cometd.bayeux.Session

    batch, endBatch, getAttribute, getAttributeNames, removeAttribute, setAttribute, startBatch
  • Constructor Details

  • Method Details

    • receive

      public void receive(org.cometd.bayeux.Message.Mutable message, org.cometd.bayeux.Promise<Void> promise)
      Overrides:
      receive in class org.cometd.common.AbstractClientSession
    • newChannel

      protected org.cometd.common.AbstractClientSession.AbstractSessionChannel newChannel(org.cometd.bayeux.ChannelId channelId)
      Specified by:
      newChannel in class org.cometd.common.AbstractClientSession
    • newChannelId

      protected org.cometd.bayeux.ChannelId newChannelId(String channelId)
      Specified by:
      newChannelId in class org.cometd.common.AbstractClientSession
    • sendBatch

      protected void sendBatch()
      Specified by:
      sendBatch in class org.cometd.common.AbstractClientSession
    • getServerSession

      public org.cometd.bayeux.server.ServerSession getServerSession()
      Specified by:
      getServerSession in interface org.cometd.bayeux.server.LocalSession
    • handshake

      public void handshake(Map<String,Object> template, org.cometd.bayeux.client.ClientSession.MessageListener callback)
      Specified by:
      handshake in interface org.cometd.bayeux.client.ClientSession
    • disconnect

      public void disconnect(org.cometd.bayeux.client.ClientSession.MessageListener callback)
      Specified by:
      disconnect in interface org.cometd.bayeux.client.ClientSession
    • getId

      public String getId()
      Specified by:
      getId in interface org.cometd.bayeux.Session
    • isConnected

      public boolean isConnected()
      Specified by:
      isConnected in interface org.cometd.bayeux.Session
    • isHandshook

      public boolean isHandshook()
      Specified by:
      isHandshook in interface org.cometd.bayeux.Session
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • send

      protected void send(org.cometd.bayeux.Message.Mutable message)
      Specified by:
      send in class org.cometd.common.AbstractClientSession
    • send

      protected void send(ServerSessionImpl session, org.cometd.bayeux.server.ServerMessage.Mutable message)

      Enqueues or sends a message to the server.

      This method will either enqueue the message, if this session is batching, or perform the send immediately.

      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.
    • newMessage

      protected org.cometd.bayeux.server.ServerMessage.Mutable newMessage()
      Overrides:
      newMessage in class org.cometd.common.AbstractClientSession