info.magnolia.event
Class ResettableEventBus

java.lang.Object
  extended by 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.


Constructor Summary
ResettableEventBus(EventBus wrappedBus)
           
 
Method Summary
<H extends EventHandler>
HandlerRegistration
addHandler(Class<? extends Event<H>> eventClass, H handler)
           
<H extends EventHandler>
void
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
 

Constructor Detail

ResettableEventBus

public ResettableEventBus(EventBus wrappedBus)
Method Detail

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-2013 Magnolia International Ltd.. All Rights Reserved.