Interface EventEmitter
-
- All Superinterfaces:
AutoCloseable
public interface EventEmitter extends AutoCloseable
Emitter is the main integration point with external systems. It will be called first to get implementation of theEventCollectionnext depending on the PersistenceEventManager implementation will provide the actual events on three phases:- deliver - is the first phase that gives complete view of events before persistence is completed
- apply - is kind of confirmation that persistence is completed and events can be safely transferred
- drop - is kind of rejection that persistence failed and events should be discarded
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidapply(Collection<InstanceView<?>> data)Indicates that given collection of events can be safely transferred to external systemsvoidclose()Closes any resources used by emitter to interact with external systemvoiddeliver(Collection<InstanceView<?>> data)Invoked just before persistence layer is completed - e.g. beforeCompletion in JTA transactionvoiddrop(Collection<InstanceView<?>> data)Indicates that given collection of events should be discardedEventCollectionnewCollection()Returns new instance of EventCollection to be used while collecting events
-
-
-
Method Detail
-
deliver
void deliver(Collection<InstanceView<?>> data)
Invoked just before persistence layer is completed - e.g. beforeCompletion in JTA transaction- Parameters:
data- complete view of events
-
apply
void apply(Collection<InstanceView<?>> data)
Indicates that given collection of events can be safely transferred to external systems- Parameters:
data- complete view of events
-
drop
void drop(Collection<InstanceView<?>> data)
Indicates that given collection of events should be discarded- Parameters:
data- complete view of events
-
newCollection
EventCollection newCollection()
Returns new instance of EventCollection to be used while collecting events- Returns:
- instance of EventCollection implementation
-
close
void close()
Closes any resources used by emitter to interact with external system- Specified by:
closein interfaceAutoCloseable
-
-