Class LocalSessionImpl

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

public class LocalSessionImpl
extends AbstractClientSession
implements LocalSession

A LocalSession implementation.

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

  • Constructor Details

    • LocalSessionImpl

      public LocalSessionImpl​(BayeuxServerImpl bayeux, java.lang.String idHint)
  • Method Details

    • receive

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

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

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

      protected void sendBatch()
      Specified by:
      sendBatch in class AbstractClientSession
    • getServerSession

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

      public void handshake​(java.util.Map<java.lang.String,​java.lang.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 java.lang.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 java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • send

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

      protected void send​(ServerSessionImpl session, 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 ServerMessage.Mutable newMessage()
      Overrides:
      newMessage in class AbstractClientSession