org.ioc.commons.flowcontrol.eventbus.EventBusBinder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ioc-commons Show documentation
Show all versions of ioc-commons Show documentation
This project defines a set of useful java interfaces for helping you in the definition of the structure of your developments in Java-projects which are designed using a Inversion-Of-Control (IOC) pattern. Useful for MVP-Pattern designs in applications coded on GWT, SWT, Android, etc.
package org.ioc.commons.flowcontrol.eventbus;
import org.ioc.commons.flowcontrol.common.BindRegistration;
/**
* Binder for events
*
* @author Jesús Lunar Pérez
*
* @param
* Event type
*/
public interface EventBusBinder> {
/**
* Binds an event to the handler which will process it when it is fired.
*
* @param event
* Event to bind
* @param handler
* Handler which will process the event
*
* @return A bind registration object for managing the new binding
* registered.
*/
BindRegistration bindEvent(E event, EventHandler handler);
/**
* Binds an event to the handler which will process it when it is fired and automatically unbind it when it finishes.
*
* @param event
* Event to bind
* @param handler
* Handler which will process the event
*
* @return A bind registration object for managing the new binding
* registered.
*/
BindRegistration bindEventOnce(E event, EventHandler handler);
}