E
- Type of event for which to listenpublic interface EventSubscriber<E extends SciJavaEvent> extends EventSubscriber<E>
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.
Modifier and Type | Method and Description |
---|---|
Class<E> |
getEventClass() |
void |
onEvent(E event)
Handle a published event.
|
void onEvent(E event)
EventSubscriber
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)
and EventService.subscribeExactlyStrongly(Class,
EventSubscriber)
.
onEvent
in interface EventSubscriber<E extends SciJavaEvent>
event
- The Object that is being published.Copyright © 2009–2023 SciJava. All rights reserved.