Class ReplicatedContext

All Implemented Interfaces:
MBeanRegistration, NotificationBroadcaster, NotificationEmitter, Container, Context, JmxEnabled, Lifecycle, AbstractReplicatedMap.MapOwner, ContextBind

public class ReplicatedContext extends StandardContext implements AbstractReplicatedMap.MapOwner
Replicated context that supports session replication across cluster nodes.
  • Field Details

    • DEFAULT_REPL_TIMEOUT

      protected static final long DEFAULT_REPL_TIMEOUT
      Default replication timeout in milliseconds.
      See Also:
  • Constructor Details

    • ReplicatedContext

      public ReplicatedContext()
      Default constructor.
  • Method Details

    • startInternal

      protected void startInternal() throws LifecycleException
      Start this component and implement the requirements of LifecycleBase.startInternal().
      Overrides:
      startInternal in class StandardContext
      Throws:
      LifecycleException - if this component detects a fatal error that prevents this component from being used
    • stopInternal

      protected void stopInternal() throws LifecycleException
      Stop this component and implement the requirements of LifecycleBase.stopInternal().
      Overrides:
      stopInternal in class StandardContext
      Throws:
      LifecycleException - if this component detects a fatal error that prevents this component from being used
    • setMapSendOptions

      public void setMapSendOptions(int mapSendOptions)
      Set the options for sending map updates. The value is only used when the context (re)starts.
      Parameters:
      mapSendOptions - the send options
    • getMapSendOptions

      public int getMapSendOptions()
      Return the options for sending map updates.
      Returns:
      the send options
    • getClassLoaders

      public ClassLoader[] getClassLoaders()
      Return the class loaders to use for serialization.
      Returns:
      the class loaders
    • getServletContext

      public ServletContext getServletContext()
      Description copied from interface: Context
      Returns the ServletContext instance for which this Context acts as a facade.
      Specified by:
      getServletContext in interface Context
      Overrides:
      getServletContext in class StandardContext
      Returns:
      the ServletContext instance, or null if not yet initialized
    • objectMadePrimary

      public void objectMadePrimary(Object key, Object value)
      Description copied from interface: AbstractReplicatedMap.MapOwner
      Called when an object becomes primary on this node.
      Specified by:
      objectMadePrimary in interface AbstractReplicatedMap.MapOwner
      Parameters:
      key - The key of the object
      value - The value of the object