org.qi4j.library.eventsourcing.domain.source.helper
Class DomainEventTracker
java.lang.Object
org.qi4j.library.eventsourcing.domain.source.helper.DomainEventTracker
- All Implemented Interfaces:
- Runnable, UnitOfWorkEventsListener
public class DomainEventTracker
- extends Object
- implements Runnable, UnitOfWorkEventsListener
Helper that enables a service to easily track transactions. Upon startup
the tracker will get all the transactions from the store since the last
check, and delegate them to the given Output. It will also register itself
with the store so that it can get continuous updates.
Then, as transactions come in from the store, they will be processed in real-time.
If a transaction is successfully handled the configuration of the service, which must
extend DomainEventTrackerConfiguration, will update the marker for the last successfully handled transaction.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DomainEventTracker
public DomainEventTracker(EventStream stream,
EventSource source,
Configuration<? extends DomainEventTrackerConfiguration> configuration,
Output<UnitOfWorkDomainEventsValue,? extends Throwable> output)
start
public void start()
stop
public void stop()
run
public void run()
- Specified by:
run
in interface Runnable
notifyTransactions
public void notifyTransactions(Iterable<UnitOfWorkDomainEventsValue> transactions)
- Specified by:
notifyTransactions
in interface UnitOfWorkEventsListener