Class InstanceManager
java.lang.Object
com.aquima.interactions.profile.model.InstanceManager
- All Implemented Interfaces:
IProfileLifecycle
,Serializable
This class manages all the instances. This class contains most logic of the profile
To prevent duplicate code this class only has methods that accept the entity id. The surrounding profile class
provides extra methods that make it possible to call the methods based on entityName.
- Since:
- 5.0
- Author:
- O. Kerpershoek, F. v.d. Meer, V. Jansen
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
InstanceManager
(IMetaModel metamodel, EventDispatcher eventDispatcher) -
Method Summary
Modifier and TypeMethodDescriptionvoid
activate
(IProfileActivationContext profileActivationContext) This method may be used for activating the profile after deserialization.addInstance
(IEntityInstance instance) This method will add the specified instance to the instance manager.protected IEntityInstance
createInstance
(String entityName, GUID instanceId, String instanceName, InstanceType type) protected IEntityInstance
deleteInstance
(EntityValue id, boolean autoDetach) protected IEntityInstance[]
getAllInstances
(String entityName, boolean includeChildren) protected IEntityDefinition
getEntityDefinition
(String entityName) protected IEventDispatcher
protected DefaultProfileFactory
protected IEntityInstance
getInstanceById
(String entityName, GUID id) protected IEntityInstance
getInstanceByName
(String entityName, String name) protected IEntityInstance
getSingleton
(String entityName) void
This method may be used for preparing the profile for serialization.
-
Constructor Details
-
InstanceManager
-
-
Method Details
-
getEventDispatcher
-
getFactory
-
getEntityDefinition
-
getSingleton
-
getInstanceById
-
getInstanceByName
-
getAllInstances
-
deleteInstance
-
createInstance
protected IEntityInstance createInstance(String entityName, GUID instanceId, String instanceName, InstanceType type) -
addInstance
This method will add the specified instance to the instance manager. This operation will clone the instance and assign a new ID to the duplicate.- Parameters:
instance
- The instance that should be cloned and added.- Returns:
- A duplicate of the instance passed.
- Throws:
AppException
- This exception is thrown when the instance could not be added or cloned.
-
passivate
public void passivate()Description copied from interface:IProfileLifecycle
This method may be used for preparing the profile for serialization.- Specified by:
passivate
in interfaceIProfileLifecycle
-
activate
Description copied from interface:IProfileLifecycle
This method may be used for activating the profile after deserialization.- Specified by:
activate
in interfaceIProfileLifecycle
- Parameters:
profileActivationContext
- the current profile activation context.
-
getMetaModel
-