Interface IInstanceContext
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
FlowContext
,ProfileContext
Interface for transaction contexts.
- Since:
- 5.0
- Author:
- O. Kerpershoek
-
Method Summary
Modifier and TypeMethodDescriptiongetActiveInstance
(String entityName) This method returns the active instance for the specified entity type.getId()
This method returns a unique ID for the instance context.This method returns the parent context of this context.This method will de-activate the last activated instance.void
pushActiveInstance
(IEntityInstance instance) This method will activate the specified instance within this context.
-
Method Details
-
getId
String getId()This method returns a unique ID for the instance context. This ID can for instance the the name of the page of the flow the context belongs to.- Returns:
- a unique ID for the instance context.
-
getParentContext
IInstanceContext getParentContext()This method returns the parent context of this context. The parent context is available when nested contexts are used. For instance when the flow context will have a page context as parent.- Returns:
- the parent context of this context.
-
getActiveInstance
This method returns the active instance for the specified entity type.- Parameters:
entityName
- The entity type for which the active instance is requested.- Returns:
- The active instance for the specified entity type.
- Throws:
UnknownInstanceException
- This exception type is raised when no active instance could be found for the specified type.UnknownEntityException
- This exception type is raised when the entity type is unknown.CreateInstanceException
- This type of exception may be raised when a singleton instance could not be created for the specified type.
-
popActiveInstance
IEntityInstance popActiveInstance()This method will de-activate the last activated instance.- Returns:
- The instance that was de-actived.
-
pushActiveInstance
This method will activate the specified instance within this context.- Parameters:
instance
- The instance that should be made active.
-