Example usage for com.google.common.eventbus EventHandler handleEvent

List of usage examples for com.google.common.eventbus EventHandler handleEvent

Introduction

In this page you can find the example usage for com.google.common.eventbus EventHandler handleEvent.

Prototype

public void handleEvent(Object paramObject) throws InvocationTargetException 

Source Link

Usage

From source file:com.sk89q.worldedit.util.eventbus.EventBus.java

/**
 * Dispatches {@code event} to the handler in {@code handler}.  This method
 * is an appropriate override point for subclasses that wish to make
 * event delivery asynchronous.//from w  w w  .java 2  s.  c om
 *
 * @param event  event to dispatch.
 * @param handler  handler that will call the handler.
 */
protected void dispatch(Object event, EventHandler handler) {
    try {
        handler.handleEvent(event);
    } catch (InvocationTargetException e) {
        logger.log(Level.SEVERE, "Could not dispatch event: " + event + " to handler " + handler, e);
    }
}

From source file:blow.eventbus.OrderedEventBus.java

/**
 * Dispatches {@code event} to the handler in {@code wrapper}.  This method
 * is an appropriate override point for subclasses that wish to make
 * event delivery asynchronous.//from w  w  w . j  av a  2 s  .c  o m
 *
 * @param event  event to dispatch.
 * @param wrapper  wrapper that will call the handler.
 */
protected void dispatch(Object event, EventHandler wrapper) throws InvocationTargetException {
    wrapper.handleEvent(event);
}