public interface HippoEventListener
HippoEventListener
interface and implement onEvent(HippoEvent)
to
get a callback whenever a HippoEvent
is posted to the HippoEventBus
by HippoEventBus.post(Object)
Note that this is a convenience interface; it is not necessary to use, as any method that is annotated with the
@Subscribe annotation and has a HippoEvent argument type, will be invoked.
Example code:
// get the eventBus HippoEventBus eventBus = HippoServiceRegistry.getService(HippoEventBus.class); eventBus.register(new HippoEventListener() { // implement the onEvent method // Note that the method with the annotation MUST be public public void onEvent(HippoEvent> event) { System.out.println(event); } });
Modifier and Type | Method and Description |
---|---|
void |
onEvent(HippoEvent<?> event) |
void onEvent(HippoEvent<?> event)
event
- the HippoEvent
Copyright © 2012–2017 Hippo B.V. (http://www.onehippo.com). All rights reserved.