Class PortalContext
java.lang.Object
com.aquima.interactions.portal.model.session.PortalContext
- All Implemented Interfaces:
Interruptible
,IPortalContext
,ISessionLifecycle
,IInternalPortalContext
,Serializable
- Direct Known Subclasses:
TxPortalContext
public abstract class PortalContext
extends Object
implements IInternalPortalContext, ISessionLifecycle, Interruptible
Base class for the portal context.
- Since:
- 6.0
- Author:
- O. Kerpershoek
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
PortalContext
(ISolution solution, IModule module, Channel channel) protected
PortalContext
(ISolution solution, IModule module, IPortalMessageBus messageBus, ISessionState sessionDump) protected
PortalContext
(PortalContext other) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
void
activate
(ISessionActivationContext sessionActivationContext) This method may be used for activating the objects after deserialization.protected abstract void
commitTransaction
(String name) protected abstract void
completeFlow
(String flowName) protected void
destroy()
This method returns a portal context for the specified module.This method returns a portal context for the specified module.This method returns the current application.This method returns the current application mode.This method returns the current application model.This method returns the audit engine.Returns the case engine client, may be nullprotected Channel
protected String
Returns the comments managerThis method returns the current communication engine for the current context.This method returns the composer of the application.This method returns the application configuration.This method may be used to request the connection manager of the application.This method returns the content manager factory for the current contextgetContentManagerFactory
(PersistenceLevel persistence) Returns a content manager factory for the current context and the given persistence level.Returns the current top-level flow.This method returns the current language of the portal context (session).protected String
Returns a debugger instance if one is currently attached, or null if no debugger is attached.This method returns a document engine for the current context.This method returns an element factory that may be used to expand pre-defined elements from the composer using the current container context.Holds the expression parser which is bound to the rule engine.This method returns the factory manager of the current application.The flow engine for the current session.This method returns the current flow state of the portal context (session).This method returns a function call definition manager for the current context.getId()
This method returns the ID of the application.For internal use only.This method returns an element factory that may be used to expand pre-defined elements from the composer using the mapping context.This method returns a mapping manager for the current context.This method returns a mask manager for the current context.This method returns the match engine as configured for the application.Returns the metamodel for which the current portal-session is constructed.Retrieves the page scope form the context.This method returns a process scope for the current context.Returns the project for which the current portal-session is constructed.protected EventErrors
Retrieves the request scope form the context.Retrieves the resource manager.Returns the rule-engine for which the current portal-session is constructed.This method returns a service manager for the current context.Returns the ID of the session.This object contains parameters and information the entire session.getState()
Returns the state of the portalcontext (for serialization).protected abstract TmsProfile
This method returns the trace engine.The tree engine for the current session.protected IUserData
getUser()
Retrieves the user scope for the current user from the context.This method returns the webservices for the current context.void
Sets the interrupted flag, indicating that this object should interrupt the computation it is currently performing (typically on another thread) as soon as possible, and exit by throwing anInterruptedException
.boolean
Indicates whether the interrupted flag has been set.protected void
protected void
onStartPage
(boolean isSamePage, RequestAction action) protected void
onStartRequest
(EventErrors errors, Map<String, ?> parameters) protected void
void
This method may be used for preparing the objects for serialization.void
restore
(IPortalContextState state) Clears the current state and overrides it with the provided state.protected abstract void
rollbackTransaction
(String name) protected void
setCurrentLanguage
(String languageCode) protected void
setFlowState
(IFlowState flowState) void
setProcessScope
(IProcessScope processScope) protected void
setSessionId
(String sessionId) void
For internal use only and should never be exposed via the portal context interface.void
setSessionScope
(PortalContext other) Method to use the session scope of the provided portal context.protected abstract void
protected abstract void
startTransaction
(String name) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.aquima.interactions.portal.IPortalContext
getActiveInstance, getFlowScope, getProfile, getUserProfile, pushActiveInstance
-
Constructor Details
-
PortalContext
-
PortalContext
-
PortalContext
protected PortalContext(ISolution solution, IModule module, IPortalMessageBus messageBus, ISessionState sessionDump)
-
-
Method Details
-
getTmsProfile
-
startFlow
-
abortFlow
-
completeFlow
-
startTransaction
-
commitTransaction
-
rollbackTransaction
-
getId
Description copied from interface:IInternalPortalContext
This method returns the ID of the application.- Specified by:
getId
in interfaceIInternalPortalContext
- Returns:
- the ID of the application.
-
getCurrentLanguage
This method returns the current language of the portal context (session).- Specified by:
getCurrentLanguage
in interfaceIPortalContext
- Returns:
- the current language of the portal context (session).
-
setCurrentLanguage
-
getSessionId
Description copied from interface:IPortalContext
Returns the ID of the session.- Specified by:
getSessionId
in interfaceIPortalContext
- Returns:
- the id of the session (may be null).
-
setSessionId
-
getCurrentFlow
Description copied from interface:IPortalContext
Returns the current top-level flow.- Specified by:
getCurrentFlow
in interfaceIPortalContext
- Returns:
- The current top-level flow.
-
getFlowState
This method returns the current flow state of the portal context (session).- Returns:
- the current flow state of the portal context (session).
-
setFlowState
-
getCurrentPageName
-
getConfiguration
Description copied from interface:IInternalPortalContext
This method returns the application configuration. The configuration might be useful for services and containers, and may therefore be moved to the IPortalContext interface if needed.- Specified by:
getConfiguration
in interfaceIInternalPortalContext
- Returns:
- the application configuration.
-
getApplicationModel
Description copied from interface:IInternalPortalContext
This method returns the current application model.- Specified by:
getApplicationModel
in interfaceIInternalPortalContext
- Returns:
- The current application model.
-
getChannelName
-
getChannel
-
getUser
-
getMetaModel
Description copied from interface:IPortalContext
Returns the metamodel for which the current portal-session is constructed. This metamodel does not necessarily reflect the most recent version but it is the exact version this session was started with.- Specified by:
getMetaModel
in interfaceIPortalContext
- Returns:
- The metamodel which is never null.
-
getResourceManager
Description copied from interface:IPortalContext
Retrieves the resource manager.- Specified by:
getResourceManager
in interfaceIPortalContext
- Returns:
- Resource manager for the current session.
-
getConnectionManager
Description copied from interface:IPortalContext
This method may be used to request the connection manager of the application. The connection manager services the connections that are predefined for the application.- Specified by:
getConnectionManager
in interfaceIPortalContext
- Returns:
- the connection manager of the application.
-
getFactoryManager
This method returns the factory manager of the current application. The factory manager is not intended to be used by custom components, and is thus not exposed through the interface.Note: this method is not part of the IPortalContext interface.
- Specified by:
getFactoryManager
in interfaceIInternalPortalContext
- Returns:
- The factory manager of the current application.
-
getRuleEngine
Description copied from interface:IPortalContext
Returns the rule-engine for which the current portal-session is constructed. This rule-engine does not necessarily reflect the most recent version with the most recent rules however it is the exact version this session was started with.- Specified by:
getRuleEngine
in interfaceIPortalContext
- Returns:
- The rule-engine which is never null.
-
getMatchEngine
Description copied from interface:IPortalContext
This method returns the match engine as configured for the application.- Specified by:
getMatchEngine
in interfaceIPortalContext
- Returns:
- the match engine as configured for the application.
-
getComposer
This method returns the composer of the application.Note: this method is not part of the IPortalContext interface.
- Specified by:
getComposer
in interfaceIInternalPortalContext
- Returns:
- the composer of the application.
-
getElementComposer
Description copied from interface:IPortalContext
This method returns an element factory that may be used to expand pre-defined elements from the composer using the current container context.- Specified by:
getElementComposer
in interfaceIPortalContext
- Returns:
- An element factory that can be used to expand elements from the composer.
-
getMappingComposer
Description copied from interface:IPortalContext
This method returns an element factory that may be used to expand pre-defined elements from the composer using the mapping context.- Specified by:
getMappingComposer
in interfaceIPortalContext
- Returns:
- An element factory that can be used to expand elements from the composer.
-
getTreeEngine
Description copied from interface:IPortalContext
The tree engine for the current session.- Specified by:
getTreeEngine
in interfaceIPortalContext
- Returns:
- The tree-engine which is never null.
-
getExpressionParser
Description copied from interface:IPortalContext
Holds the expression parser which is bound to the rule engine. One can use this to prepare expressions for evaluation.- Specified by:
getExpressionParser
in interfaceIPortalContext
- Returns:
- The expression parser which is never null
-
getFlowEngine
Description copied from interface:IPortalContext
The flow engine for the current session.- Specified by:
getFlowEngine
in interfaceIPortalContext
- Returns:
- The flow-engine which is never null.
-
getTraceEngine
Description copied from interface:IPortalContext
This method returns the trace engine.- Specified by:
getTraceEngine
in interfaceIPortalContext
- Returns:
- the Trace Engine.
-
getAuditEngine
Description copied from interface:IPortalContext
This method returns the audit engine. The audit engine can be used to log messages that can later be used to audit users behaviour inside the application. It is up to the developer to call the audit engine's audit functionality on the appropriate times when user activity should be logged.- Specified by:
getAuditEngine
in interfaceIPortalContext
- Returns:
- the Audit Engine.
-
getApplicationMode
Description copied from interface:IPortalContext
This method returns the current application mode. Never returns null- Specified by:
getApplicationMode
in interfaceIPortalContext
- Returns:
- The current application mode.
-
onStartRequest
-
onEndRequest
protected void onEndRequest() -
getRequestErrorMap
-
onStartTransition
protected void onStartTransition() -
onStartPage
-
getUserScope
Description copied from interface:IPortalContext
Retrieves the user scope for the current user from the context. This object's life time is shared over sessions and applications.- Specified by:
getUserScope
in interfaceIPortalContext
- Returns:
- A request scope corresponding to this request. Never null
- See Also:
-
getRequestScope
Description copied from interface:IPortalContext
Retrieves the request scope form the context. This object contains parameters and information about the request.- Specified by:
getRequestScope
in interfaceIPortalContext
- Returns:
- A request scope corresponding to this request. Never null
- See Also:
-
getPageScope
Description copied from interface:IPortalContext
Retrieves the page scope form the context. This object contains parameters and information as long as the portal-engine is on the same page. After the page is left the scope is changed and is cleared to hold new properties bound to that page.- Specified by:
getPageScope
in interfaceIPortalContext
- Returns:
- The page-bound scope which is never null.
- See Also:
-
getSessionScope
Description copied from interface:IPortalContext
This object contains parameters and information the entire session. This means from the portalsession is created until it has been destroyed. One could say the session scope lives at least as long as one is working with a specific application and profile.- Specified by:
getSessionScope
in interfaceIPortalContext
- Returns:
- The session-bound scope which is never null.
- See Also:
-
getInternalSessionScope
For internal use only. -
getDocumentEngine
Description copied from interface:IPortalContext
This method returns a document engine for the current context.- Specified by:
getDocumentEngine
in interfaceIPortalContext
- Returns:
- Document engine for the current session.
-
getServiceManager
Description copied from interface:IPortalContext
This method returns a service manager for the current context. Never returns null- Specified by:
getServiceManager
in interfaceIPortalContext
- Returns:
- A service manager for the current session.
-
getFunctionCallDefinitionManager
Description copied from interface:IPortalContext
This method returns a function call definition manager for the current context. Never returns null- Specified by:
getFunctionCallDefinitionManager
in interfaceIPortalContext
- Returns:
- A function call definition manager for the current session.
-
getMaskManager
Description copied from interface:IPortalContext
This method returns a mask manager for the current context. Never returns null- Specified by:
getMaskManager
in interfaceIPortalContext
- Returns:
- A mask manager for the current session.
-
getContentManagerFactory
Description copied from interface:IPortalContext
This method returns the content manager factory for the current context- Specified by:
getContentManagerFactory
in interfaceIPortalContext
- Returns:
- A content manager factory
-
getContentManagerFactory
Description copied from interface:IPortalContext
Returns a content manager factory for the current context and the given persistence level.When the persistence level is temporary, the content created with the returned content manager factory and content manager will be deleted when a certain event occurs (eg. portal scope ends, a certain amount of time passes, etc.) The strategy used to delete the temporary content is determined by the underlying
ITemporaryPersistenceStrategy
in use.When the persistence level is permanent, the content must explicitly be deleted from the connection when it is no longer needed.
- Specified by:
getContentManagerFactory
in interfaceIPortalContext
- Parameters:
persistence
- the desired persistence level- Returns:
- the content manager factory, never null
-
setProcessScope
-
getProcessScope
Description copied from interface:IPortalContext
This method returns a process scope for the current context. Never returns null- Specified by:
getProcessScope
in interfaceIPortalContext
- Returns:
- A process scope.
-
getProject
Description copied from interface:IPortalContext
Returns the project for which the current portal-session is constructed. This project does not necessarily reflect the most recent version but it is the exact version this session was started with.- Specified by:
getProject
in interfaceIPortalContext
- Returns:
- The project which is never null.
-
getMappingManager
Description copied from interface:IPortalContext
This method returns a mapping manager for the current context. Never returns null- Specified by:
getMappingManager
in interfaceIPortalContext
- Returns:
- A mapping manager for the current session.
-
setSessionScope
Method to use the session scope of the provided portal context.This method is for internal use only and should never be exposed via the portal context interface.
- Parameters:
other
- The other context, may not be null.
-
setSessionScope
For internal use only and should never be exposed via the portal context interface.- Parameters:
other
- the other session scope, may not be null.
-
forModule
Description copied from interface:IPortalContext
This method returns a portal context for the specified module. If the module id refers to module of this context: 'this' is returned. Otherwise a new portal context (with empty state) is returned.- Specified by:
forModule
in interfaceIPortalContext
- Parameters:
moduleId
- The module id, may not be null.- Returns:
- The portal context for the specified module.
-
forModule
Description copied from interface:IPortalContext
This method returns a portal context for the specified module. If `createNew` is true, a new portal context (with empty state) is returned even if the module id refers to the module of this context. Otherwise, this method behaves identically toIPortalContext.forModule(ModuleID)
.- Specified by:
forModule
in interfaceIPortalContext
- Parameters:
moduleId
- The module id, may not be null.createNew
- Whether to create a new, empty, portal context even if this context refers to the requested module id.- Returns:
- The portal context for the specified module.
-
getCommunicationEngine
Description copied from interface:IPortalContext
This method returns the current communication engine for the current context.- Specified by:
getCommunicationEngine
in interfaceIPortalContext
- Returns:
- The communication engine, never null.
-
getWebServices
Description copied from interface:IPortalContext
This method returns the webservices for the current context.- Specified by:
getWebServices
in interfaceIPortalContext
- Returns:
- The webservices, never null.
-
getState
Description copied from interface:IPortalContext
Returns the state of the portalcontext (for serialization).- Specified by:
getState
in interfaceIPortalContext
- Returns:
- returns the current state of the portalcontext.
-
restore
Description copied from interface:IPortalContext
Clears the current state and overrides it with the provided state.- Specified by:
restore
in interfaceIPortalContext
- Parameters:
state
- The new state for this context.
-
getApplication
Description copied from interface:IInternalPortalContext
This method returns the current application.- Specified by:
getApplication
in interfaceIInternalPortalContext
- Returns:
- The current application.
-
getCaseEngineClient
Description copied from interface:IPortalContext
Returns the case engine client, may be null- Specified by:
getCaseEngineClient
in interfaceIPortalContext
- Returns:
- the case engine client, may be null
-
getCommentsManager
Description copied from interface:IPortalContext
Returns the comments manager- Specified by:
getCommentsManager
in interfaceIPortalContext
- Returns:
- the comments manager
-
getDebugger
Description copied from interface:IPortalContext
Returns a debugger instance if one is currently attached, or null if no debugger is attached.- Specified by:
getDebugger
in interfaceIPortalContext
- Returns:
- a debugger instance, or null if none is attached.
-
destroy
protected void destroy() -
activate
Description copied from interface:ISessionLifecycle
This method may be used for activating the objects after deserialization.- Specified by:
activate
in interfaceISessionLifecycle
- 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 interfaceISessionLifecycle
-
interrupt
public void interrupt()Description copied from interface:Interruptible
Sets the interrupted flag, indicating that this object should interrupt the computation it is currently performing (typically on another thread) as soon as possible, and exit by throwing anInterruptedException
.- Specified by:
interrupt
in interfaceInterruptible
-
isInterrupted
public boolean isInterrupted()Description copied from interface:Interruptible
Indicates whether the interrupted flag has been set.- Specified by:
isInterrupted
in interfaceInterruptible
- Returns:
- true if the interrupted flag is set, false otherwise.
-