Interface EventSubscriber<E extends SciJavaEvent>
-
- Type Parameters:
E- Type of event for which to listen
- All Superinterfaces:
EventSubscriber<E>
public interface EventSubscriber<E extends SciJavaEvent> extends EventSubscriber<E>
Interface for subscribers that wish to be notified of SciJava events.There is no defined order to the notifications. This is an intentional limitation, to keep the event subsystem from growing too complex. We have found that when event handlers need to make assumptions about the order events are delivered, there is generally something wrong with the event delivery pattern in question. A better solution is to fire more granular types of events at multiple stages of the program's workflow.
- Author:
- Curtis Rueden
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Class<E>getEventClass()voidonEvent(E event)Handle a published event.
-
-
-
Method Detail
-
onEvent
void onEvent(E event)
Description copied from interface:EventSubscriberHandle a published event.The EventService calls this method on each publication of an object that matches the class or interface passed to one of the EventService's class-based subscribe methods, specifically,
EventService.subscribe(Class,EventSubscriber)EventService.subscribeExactly(Class,EventSubscriber)EventService.subscribeStrongly(Class,EventSubscriber)andEventService.subscribeExactlyStrongly(Class, EventSubscriber).- Specified by:
onEventin interfaceEventSubscriber<E extends SciJavaEvent>- Parameters:
event- The Object that is being published.
-
-