info.magnolia.event
Class ResettableEventBus
java.lang.Object
info.magnolia.event.ResettableEventBus
- All Implemented Interfaces:
- EventBus
public class ResettableEventBus
- extends Object
- implements EventBus
Wraps an EventBus and remembers all handlers registered via this wrapper, so that they can easily all be cleared at once.
Inspired by com.google.gwt.event.shared.ResettableEventBus.
Method Summary |
|
addHandler(Class<? extends Event<H>> eventClass,
H handler)
|
|
fireEvent(Event<H> event)
Fires the event on the bus (synchronously). |
void |
reset()
Remove all handlers that have been added through this wrapper. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ResettableEventBus
public ResettableEventBus(EventBus wrappedBus)
addHandler
public <H extends EventHandler> HandlerRegistration addHandler(Class<? extends Event<H>> eventClass,
H handler)
- Specified by:
addHandler
in interface EventBus
fireEvent
public <H extends EventHandler> void fireEvent(Event<H> event)
- Description copied from interface:
EventBus
- Fires the event on the bus (synchronously).
- Specified by:
fireEvent
in interface EventBus
reset
public void reset()
- Remove all handlers that have been added through this wrapper.
Copyright © 2003-2014 Magnolia International Ltd.. All Rights Reserved.