A contract for delayed creation of event(s) objects for conditional event publishing.
The responsibility of storing enough context to create the event(s) later lies on the implementations. As one would imagine, this creator will mostly be stateful and hence be instantiated afresh for every call.
The event(s) will be created iff there exists a listener that will process these event(s). However, due to the concurrent nature of the event bus, this may not always be the case, as the listeners may come and go between the existence check and actual invocation.
Multiple events
A single event creator can create multiple events at the same time. This is required to batch multiple event types together in one conditional publish to aid optimization of multiple publish calls. The event bus takes care of managing the mapping between the event type and listeners that showed interest when {@link EventBus#publishIffNotDead(EventCreator,Class[])} was called for this creator.
@author Nitesh Kant (nkant@netflix.com)