Class ConcurrentSessionScope

All Implemented Interfaces:
IDisposableScope, IPortalMessageScope, IPortalScope, ISessionLifecycle, ISessionScope, Serializable

public class ConcurrentSessionScope extends ConcurrentPortalMessageScope implements ISessionScope
Session scope implementation that uses locking to handle concurrent method calls.
Since:
8.4.3
Author:
Jon van Leuven
See Also:
  • Constructor Details

    • ConcurrentSessionScope

      public ConcurrentSessionScope(ISessionScope sessionScope, ReadWriteLock lock)
      Construct a concurrent session scope.
      Parameters:
      sessionScope - The delegate session scope, may not be null.
      lock - The read/write lock to handle concurrent calls, may not be null.
  • Method Details

    • getCurrentFlowState

      public IFlowState getCurrentFlowState()
      Description copied from interface: ISessionScope
      Returns the current flow state N.B. We recommend one does not use this method in services and containers.
      Specified by:
      getCurrentFlowState in interface ISessionScope
      Returns:
      A flowstate
    • getActiveChannel

      public Channel getActiveChannel()
      Description copied from interface: ISessionScope
      This functions returns the current active channel if there is a channel active, otherwise when no channel is active null is returned.
      Specified by:
      getActiveChannel in interface ISessionScope
      Returns:
      The current active channel.
    • getActiveUser

      public IUserData getActiveUser()
      Description copied from interface: ISessionScope
      This function returns the current active user for the current session.
      Specified by:
      getActiveUser in interface ISessionScope
      Returns:
      The current active user, never null.
    • setUser

      public void setUser(IUserData user)
      Description copied from interface: ISessionScope
      This method will set the user for the current session. The existing user information will be discarded.
      Specified by:
      setUser in interface ISessionScope
      Parameters:
      user - The user, may not be null.
    • getTestPath

      public String getTestPath()
      Description copied from interface: ISessionScope
      This function returns the testPath for the current session.
      Specified by:
      getTestPath in interface ISessionScope
      Returns:
      The testPath for the current session
    • setTestPath

      public void setTestPath(String testPath)
      Description copied from interface: ISessionScope
      This method will set the testPath for the current session. The existing testPath will be discarded.
      Specified by:
      setTestPath in interface ISessionScope
      Parameters:
      testPath - The testpath, may be null.
    • notifyPortalMessage

      public void notifyPortalMessage(IPortalMessage message)
      Description copied from interface: ISessionScope
      Notifies a portal message after the current event has been processed.
      Specified by:
      notifyPortalMessage in interface ISessionScope
      Parameters:
      message - The portalmessage, not null.
    • getPendingPortalMessages

      public IPortalMessage[] getPendingPortalMessages()
      Description copied from interface: ISessionScope
      Retrieves the currently pending portal messages to process.
      Specified by:
      getPendingPortalMessages in interface ISessionScope
      Returns:
      The portalmessages, not null.
    • clearPendingPortalMessages

      public void clearPendingPortalMessages()
      Description copied from interface: ISessionScope
      Clears all currently pending portal messages.
      Specified by:
      clearPendingPortalMessages in interface ISessionScope
    • removePendingPortalMessages

      public IPortalMessage[] removePendingPortalMessages()
      Description copied from interface: ISessionScope
      Retrieves and clears the currently pending portal messages to process.
      Specified by:
      removePendingPortalMessages in interface ISessionScope
      Returns:
      The portal messages, not null.
    • getType

      public PortalScopeType getType()
      Description copied from interface: IPortalScope
      This method will return the scope type of the portal scope implementation.
      Specified by:
      getType in interface IPortalScope
      Returns:
      The current scope type.
    • activate

      public void activate(ISessionActivationContext sessionActivationContext)
      Description copied from interface: ISessionLifecycle
      This method may be used for activating the objects after deserialization.
      Specified by:
      activate in interface ISessionLifecycle
      Parameters:
      sessionActivationContext - the current session activation context.
    • passivate

      public void passivate()
      Description copied from interface: ISessionLifecycle
      This method may be used for preparing the objects for serialization.
      Specified by:
      passivate in interface ISessionLifecycle