Class HistoryService

java.lang.Object
ch.tocco.nice2.persist.history.impl.v2.HistoryService
All Implemented Interfaces:
SessionFactoryManagerListener

@Component public class HistoryService extends Object implements 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).