Class TxPortalContext

java.lang.Object
com.aquima.interactions.portal.model.session.PortalContext
com.aquima.interactions.portal.model.tx.TxPortalContext
All Implemented Interfaces:
Interruptible, IPortalContext, ISessionLifecycle, IInternalPortalContext, Serializable
Direct Known Subclasses:
FunctionCallContext

public class TxPortalContext extends PortalContext
Portal context implementation that supports transactions.
Since:
5.0.1
Author:
O. Kerpershoek
See Also:
  • Constructor Details

    • TxPortalContext

      public TxPortalContext(ISolution application, IModule module, Channel channel, IProfile profile)
      Constructs the context with the required parameters.
      Parameters:
      application - The application for which the context should be created.
      module - The module containing the static definitions that should be used.
      channel - The active channel.
      profile - The profile containing the state of the application.
    • TxPortalContext

      public TxPortalContext(TxPortalContext other)
      Constructs the context from another context. This will not perform a deep-clone operation, as most objects from the specified context will be used in this context.
      Parameters:
      other - The other context that should be used to initialize this context.
    • TxPortalContext

      public TxPortalContext(ISolution application, IModule module, IProfile profile, IPortalMessageBus messageBus, ISessionState sessionState)
      Constructs a portal context from a saved session state.
      Parameters:
      application - The application model.
      module - The module containing the static definitions that should be used.
      profile - The profile for the session data.
      sessionState - The session state information that should be used to initialize the context.
      Throws:
      AppException - This exception is thrown when the context could not be created using the session state information.
  • Method Details

    • getTmsProfile

      protected TmsProfile getTmsProfile()
      Specified by:
      getTmsProfile in class PortalContext
    • getActiveContext

      public IInstanceContext getActiveContext()
      This method returns the current active instance context. Note: This method is public to allow the session state access to in instance context.
      Returns:
      the current active instance context.
    • setActiveContext

      protected void setActiveContext(IInstanceContext context)
    • startFlow

      protected void startFlow(String flowName)
      Specified by:
      startFlow in class PortalContext
    • abortFlow

      protected void abortFlow(String flowName)
      Specified by:
      abortFlow in class PortalContext
    • completeFlow

      protected void completeFlow(String flowName)
      Specified by:
      completeFlow in class PortalContext
    • pushActiveInstance

      public void pushActiveInstance(IEntityInstance instance)
      Description copied from interface: IPortalContext
      This method will activate the instance in the current context. Once an instance has been activated in a portal context, the instance will stay active until the page flow the activation occurred in has been completed.
      Parameters:
      instance - The instance that should be activated.
    • startTransaction

      protected void startTransaction(String name)
      Specified by:
      startTransaction in class PortalContext
    • commitTransaction

      protected void commitTransaction(String name)
      Specified by:
      commitTransaction in class PortalContext
    • rollbackTransaction

      protected void rollbackTransaction(String name)
      Specified by:
      rollbackTransaction in class PortalContext
    • getActiveInstance

      public IEntityInstance getActiveInstance(String entityName)
      Description copied from interface: IPortalContext
      Returns the active instance connected to the specified entity name. An instance might have been activated in the following ways:
      • The instance is a singleton, and therefore always active.
      • The instance is activated through a container (only during page evaluation).
      • The instance is activated by using the pushActiveInstance within the same flow.
      Parameters:
      entityName - The entity name for which the active instance is requested.
      Returns:
      The instance that is active for the specified entity type.
    • getProfile

      public InferenceContext getProfile()
      Description copied from interface: IPortalContext
      This method will return the current profile interface. In addition to the standard profile behavior, the implementation returned here will also automatically inference unknown values, and is aware of the instances that might have been activated during the page flow.

      See also getUserProfile()

      Returns:
      Profile interface.
    • getUserProfile

      public IProfile getUserProfile()
      Description copied from interface: IPortalContext
      This method returns the profile of all the user set data. This profile may be used to retrieve the user data without any sourcing of values.
      Returns:
      The readonly user profile, never null
    • getFlowScope

      public IFlowScope getFlowScope()
      Description copied from interface: IPortalContext
      Retrieves the flow scope form the context. This object contains parameters and information for the current flow. After the flow is left the scope is changed and is cleared to hold new properties bound to that flow.
      Returns:
      The flow-bound scope which is never null.
      See Also:
    • setActiveFlowScope

      protected void setActiveFlowScope(FlowScope flowScope)
    • getActiveFlowScope

      public FlowScope getActiveFlowScope()
    • getState

      public IPortalContextState getState()
      Description copied from interface: IPortalContext
      Returns the state of the portalcontext (for serialization).
      Specified by:
      getState in interface IPortalContext
      Overrides:
      getState in class PortalContext
      Returns:
      returns the current state of the portalcontext.
    • restore

      public void restore(IPortalContextState state)
      Description copied from interface: IPortalContext
      Clears the current state and overrides it with the provided state.
      Specified by:
      restore in interface IPortalContext
      Overrides:
      restore in class PortalContext
      Parameters:
      state - The new state for this context.
    • destroy

      protected void destroy()
      Overrides:
      destroy in class PortalContext
    • 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
      Overrides:
      activate in class PortalContext
      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
      Overrides:
      passivate in class PortalContext