Package org.drools.persistence.api
Interface PersistenceContextManager
-
public interface PersistenceContextManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidbeginCommandScopedEntityManager()This method should be called at the beginning of aCommandExecutor.execute(org.kie.api.command.Command)method, when the givenExecutableRunnerinstance is responsible for handling persistence.voiddispose()Executes the necessary actions in order to clean up and dispose of the internal fields of this instance.voidendCommandScopedEntityManager()This method should only called in theSynchronization.afterCompletion(int)method.PersistenceContextgetApplicationScopedPersistenceContext()PersistenceContextgetCommandScopedPersistenceContext()default voidresetApplicationScopedPersistenceContext()
-
-
-
Method Detail
-
getApplicationScopedPersistenceContext
PersistenceContext getApplicationScopedPersistenceContext()
- Returns:
- a
PersistenceContextinstance containing the Application Scoped EntityManager or persistence helper class.
-
getCommandScopedPersistenceContext
PersistenceContext getCommandScopedPersistenceContext()
- Returns:
- a
PersistenceContextinstance containing the Command Scoped EntityManager or persistence helper class.
-
beginCommandScopedEntityManager
void beginCommandScopedEntityManager()
This method should be called at the beginning of aCommandExecutor.execute(org.kie.api.command.Command)method, when the givenExecutableRunnerinstance is responsible for handling persistence. See thePersistableRunnerclass. The first responsibility of this method is to make sure that the Command Scoped EntityManager (CSEM) joins the ongoing transaction. When the CSEM is internally managed, this method is also responsible for creating a new CSEM for use during execution of theCommandor operation being executed by theKieSession.
-
endCommandScopedEntityManager
void endCommandScopedEntityManager()
This method should only called in theSynchronization.afterCompletion(int)method. It is responsible for cleaning up the Command Scoped EntityManager (CSEM) instance, but only when the CSEM is an internal one, and not one supplied (and managed) by the user. If the CSEM is (internally) managed, then this method will take the necessary actions in order to make sure that a new CSEM can be generated at the beginning of the next operation or command on the persistentKieSession. if the CSEM is supplied (and managed) by the user, this method will do nothing with the CSEM.
-
dispose
void dispose()
Executes the necessary actions in order to clean up and dispose of the internal fields of this instance.
-
resetApplicationScopedPersistenceContext
default void resetApplicationScopedPersistenceContext()
-
-