Example usage for com.google.common.eventbus SubscriberExceptionContext getEvent

List of usage examples for com.google.common.eventbus SubscriberExceptionContext getEvent

Introduction

In this page you can find the example usage for com.google.common.eventbus SubscriberExceptionContext getEvent.

Prototype

public Object getEvent() 

Source Link

Usage

From source file:uk.jamierocks.mana.carbon.util.event.Slf4jEventLoggingHandler.java

private static String message(SubscriberExceptionContext context) {
    Method method = context.getSubscriberMethod();
    return "Exception thrown by subscriber method " + method.getName() + '('
            + method.getParameterTypes()[0].getName() + ')' + " on subscriber " + context.getSubscriber()
            + " when dispatching event: " + context.getEvent();
}

From source file:me.jamiemansfield.guide.event.Slf4jSubscriberExceptionHandler.java

/**
 * Produces the message to use as an exception is logged.
 *
 * @param context The exception context/*from   w w w.j av  a2  s  .  c  om*/
 * @return The message to log
 */
private static String message(final SubscriberExceptionContext context) {
    final Method method = context.getSubscriberMethod();
    return "Exception thrown by subscriber method " + method.getName() + '('
            + method.getParameterTypes()[0].getName() + ')' + " on subscriber " + context.getSubscriber()
            + " when dispatching event: " + context.getEvent();
}

From source file:me.gloriouseggroll.quorrabot.event.ExceptionHandler.java

@Override
public void handleException(Throwable thrwbl, SubscriberExceptionContext sec) {
    com.gmt2001.Console.err.println("Failed to dispatch event " + sec.getEvent().toString() + " to "
            + sec.getSubscriberMethod().toString());
    com.gmt2001.Console.err.printStackTrace(thrwbl);
}

From source file:org.apache.isis.core.runtime.services.eventbus.adapter.EventBusImplementationForGuava.java

protected SubscriberExceptionHandler newEventBusSubscriberExceptionHandler() {
    return new SubscriberExceptionHandler() {
        @Override/*from  www . j av a  2s .com*/
        public void handleException(final Throwable exception, final SubscriberExceptionContext context) {
            final Object event = context.getEvent();
            processException(exception, event);
        }

    };
}

From source file:org.jbb.lib.eventbus.EventExceptionHandler.java

@Override
public void handleException(Throwable exception, SubscriberExceptionContext context) {
    log.error("Error during event [{}] consuming by client {} in method {}", context.getEvent(), exception,
            context.getSubscriber(), context.getSubscriberMethod());
}

From source file:org.sonatype.nexus.common.event.Slf4jSubscriberExceptionHandler.java

@Override
public void handleException(final Throwable exception, final SubscriberExceptionContext context) {
    logger.error("Could not dispatch event {} to subscriber {} method [{}]", context.getEvent(),
            context.getSubscriber(), context.getSubscriberMethod(), exception);
}

From source file:net.caseif.flint.common.event.FlintSubscriberExceptionHandler.java

@Override
public void handleException(Throwable exception, SubscriberExceptionContext context) {
    CommonCore.logSevere("Failed to dispatch event " + context.getEvent().getClass() + " to "
            + context.getSubscriberMethod());
    exception.printStackTrace();/*from  ww  w  .  ja v  a  2  s.c  om*/
}

From source file:io.janusproject.kernel.services.jdk.executors.JdkUncaughtExceptionHandler.java

/** {@inheritDoc}
 *///from w w w.  j av a 2s.co m
@Override
public void handleException(Throwable exception, SubscriberExceptionContext context) {
    log(exception, context.getEventBus().toString(), context.getEvent().toString());
}

From source file:org.muhia.app.psi.portal.eventbus.AsyncEventbusService.java

@Override
public void handleException(Throwable exception, SubscriberExceptionContext context) {
    Logger.getLogger(this.getClass().getName()).log(Level.SEVERE,
            "Handler " + context.getSubscriber() + " could not handle "
                    + context.getEvent().getClass().getName() + "[" + context.getEvent() + "]: "
                    + exception.getMessage(),
            exception);//  www. jav  a  2 s.c  om
}

From source file:org.muhia.app.psi.portal.eventbus.SyncEventBusService.java

@Override
public void handleException(@Nonnull Throwable exception, SubscriberExceptionContext context) {
    Logger.getLogger(this.getClass().getName()).log(Level.SEVERE,
            "Handler " + context.getSubscriber() + " could not handle "
                    + context.getEvent().getClass().getName() + "[" + context.getEvent() + "]: "
                    + exception.getMessage(),
            exception);/*  www. j  a va  2  s.c o  m*/

}