Class HistoryService
java.lang.Object
ch.tocco.nice2.persist.history.impl.v2.HistoryService
- All Implemented Interfaces:
SessionFactoryManagerListener
This class (split up into several listener inner classes) provides the entire functionality to create a history entry.
This service needs to be loaded eagerly, so that it can be attached to every new context.
This class is a
ContextCreationListener
and gets notified when a new Context
is created.
It then registers a HistoryService.HistoryEntityFacadeListener
that receives all events and schedules the creation of
a history entry if required.
For every newly created transaction, an HistoryService.PrepareHistoryDataListener
is registered. This listeners
prepares the history data that should be saved (a DetachedEntity
).
Finally the HistoryService.HistoryWriter
(after commit) converts the DetachedEntity
into an XML format and saves them to
the data store (asynchronously).-
Field Summary
-
Constructor Summary
ConstructorDescriptionHistoryService
(SecurityManager securityManager, HistoryDataStore historyDataStore, BusinessUnitManager businessUnitManager, CommandExecutor commandExecutor, HistoryConfiguration historyConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionvoid
sessionCreated
(PersistenceSession session) void
setSynchronousSave
(boolean synchronousSave) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.persist.core.api.hibernate.listener.SessionFactoryManagerListener
sessionClosing
-
Field Details
-
HISTORY_SNAPSHOT_ENTITIES
- See Also:
-
HISTORY_DETACHED_ENTITIES
- See Also:
-
-
Constructor Details
-
HistoryService
public HistoryService(SecurityManager securityManager, HistoryDataStore historyDataStore, BusinessUnitManager businessUnitManager, CommandExecutor commandExecutor, HistoryConfiguration historyConfiguration)
-
-
Method Details
-
setSynchronousSave
public void setSynchronousSave(boolean synchronousSave) -
sessionCreated
- Specified by:
sessionCreated
in interfaceSessionFactoryManagerListener
-