Class NetworkContext

java.lang.Object
com.levigo.jadice.web.transport.server.NetworkContext

public abstract class NetworkContext extends Object
Deprecated.
use TransportManagerProvider instead
A NetworkContext that provides the possibility to register NetworkContext.NetworkInitializedListeners and ClientSessionListeners.

As the network layer gets initialized after the server application is built, this class provides a NetworkContext.NetworkInitializedListener to get informed on the initialization of the network layer.

Use isInitialized() to check if the network layer is initialized and get() in order to obtain the instance.

  • Constructor Details

    • NetworkContext

      public NetworkContext()
      Deprecated.
  • Method Details

    • addClientSessionListener

      public abstract void addClientSessionListener(ClientSessionListener listener)
      Deprecated.
      Registers a ClientSessionListener. The listener gets informed on events of client sessions.
      Parameters:
      listener - the listener to register
    • removeClientSessionListener

      public abstract void removeClientSessionListener(ClientSessionListener listener)
      Deprecated.
      Removes a previous registered ClientSessionListener.
      Parameters:
      listener - the listener to remove
    • getClients

      public abstract List<Client> getClients()
      Deprecated.
      Returns a list of all clients known by this server.
      Returns:
      the list of Clients
    • get

      public static NetworkContext get()
      Deprecated.
      This returns the NetworkContext. The NetworkContext gets initialized by the com.levigo.jadice.web.transport.server.TransportWebtoolkitFilter and supplemented with further details by other components once they are initialized.

      Calling this method prior to the initialization this will return null.

      Returns:
      the NetworkContext, or null if none was initialize yet
    • set

      protected static void set(NetworkContext connectionContext)
      Deprecated.
      This is an automatic setter used by the com.levigo.jadice.web.transport.server.TransportWebtoolkitFilter in order to set the NetworkContext and inform all NetworkContext.NetworkInitializedListeners that are registered.
      Parameters:
      connectionContext - that was established
    • addNetworkInitializedListener

      public static void addNetworkInitializedListener(NetworkContext.NetworkInitializedListener initializedListener)
      Deprecated.
      Parameters:
      initializedListener - the listener that gets informed on the session layer initializion
    • removeNetworkInitializedListener

      public static void removeNetworkInitializedListener(NetworkContext.NetworkInitializedListener initializedListener)
      Deprecated.
      Parameters:
      initializedListener - the listener that should be removed
    • isInitialized

      public static boolean isInitialized()
      Deprecated.
      Checks if the NetworkContext was initialized. If this yields true, get() can be called to obtain the current NetworkContext instance.
      Returns:
      true if the NetworkContext was initialized, false if not