Java 类com.google.common.eventbus.DeadEvent 实例源码

项目:signalk-server-java    文件:FullExportProcessor.java   
/**
 * @param pathEvent
 */
/*@Subscribe
public void recordEvent(PathEvent pathEvent) {
    if (pathEvent == null)
        return;
    if (pathEvent.getPath() == null)
        return;
    //if (logger.isTraceEnabled())logger.trace(this.wsSession + " received event " + pathEvent.getPath());
    if(logger.isDebugEnabled())logger.debug(this.wsSession + " received event " + pathEvent.getPath());
    // do we care?
    for (Subscription s : manager.getSubscriptions(wsSession)) {
        if (s.isActive() && !POLICY_FIXED.equals(s.getPolicy()) && s.isSubscribed(pathEvent.getPath())) {
            if(logger.isDebugEnabled())logger.debug("Adding to send queue : "+pathEvent.getPath());
            queue.add(pathEvent.getPath());
            sender.startSender();
            break;
        }
    }

}*/
@Subscribe
public void recordEvent(DeadEvent e) {
    logger.debug("Received dead event" + e.getSource());
}
项目:cursus-ui    文件:WeakEventBus.java   
/**
 * Posts an event to all registered handlers. This method will return
 * successfully after the event has been posted to all handlers, and
 * regardless of any exceptions thrown by handlers.
 * 
 * <p>
 * If no handlers have been subscribed for {@code event}'s class, and {@code event} is not already a {@link DeadEvent}, it will be wrapped in a DeadEvent
 * and reposted.
 * 
 * @param event
 *            event to post.
 */
public void post(Object event) {
    Set<Class<?>> dispatchTypes = flattenHierarchy(event.getClass());

    boolean dispatched = false;
    for (Class<?> eventType : dispatchTypes) {
        Set<EventHandler> wrappers = getHandlersForEventType(eventType);

        if (wrappers != null && !wrappers.isEmpty()) {
            dispatched = true;
            for (EventHandler wrapper : wrappers) {
                enqueueEvent(event, wrapper);
            }
        }
    }

    if (!dispatched && !(event instanceof DeadEvent)) {
        post(new DeadEvent(this, event));
    }

    dispatchQueuedEvents();
}
项目:Camel    文件:GuavaEventBusConsumingDeadEventsTest.java   
@Test
public void shouldForwardMessageToCamel() throws InterruptedException {
    // Given
    Date message = new Date();

    // When
    eventBus.post(message);

    // Then
    getMockEndpoint("mock:customListenerEvents").setExpectedMessageCount(0);
    assertMockEndpointsSatisfied();
    getMockEndpoint("mock:deadEvents").setExpectedMessageCount(1);
    assertMockEndpointsSatisfied();
    assertEquals(message, getMockEndpoint("mock:deadEvents").getExchanges().get(0).getIn().getBody(DeadEvent.class).getEvent());
}
项目:blockplus    文件:BlockplusServer.java   
@Subscribe
@AllowConcurrentEvents
public void onDeadEvent(final DeadEvent deadEvent) {
    final Object event = deadEvent.getEvent();
    if (event instanceof IEvent) {
        final IEvent eventInterface = (IEvent) event;
        eventInterface.getEndpoint().emit("dead event", "\"" + eventInterface + "\"");
    }
    else System.out.println(deadEvent.getEvent());
}
项目:benayn    文件:Events.java   
@SuppressWarnings("rawtypes")
@Subscribe public void onDeadEvent(final DeadEvent event) {
          if (event.getEvent() instanceof ExceptionEvent) {
              final ExceptionEvent e = (ExceptionEvent) event.getEvent();

              ((Log) Loggers.from(e.source().getClass())).error(String
                    .format("Unhandled ExceptionEvent on %s", wrapObj(e.source())), e.exception());
          }
      }
项目:WebPLP    文件:Main.java   
@Subscribe
public void deadEvent(DeadEvent event)
{
    System.out.println("Dead Event");
    System.out.println(event.getEvent());
}
项目:WebPLP    文件:PLPWebController.java   
@Subscribe
public void deadEvent(DeadEvent event)
{
    System.out.println("Dead Event");
    System.out.println(event.getEvent());
}
项目:Mastering-Mesos    文件:PubsubEventModule.java   
@Subscribe
public void logDeadEvent(DeadEvent event) {
  log.warn(String.format(DEAD_EVENT_MESSAGE, event.getEvent()));
}
项目:javacode-demo    文件:DeadEventListener.java   
@Subscribe
public void listen(DeadEvent event) {
    notDelivered = true;
}
项目:ftc    文件:EventBusExperiments.java   
@Subscribe
public void handleDeadEvent(DeadEvent deadEvent) {
    System.out.println("dead event: " + deadEvent.getSource().toString());
}
项目:Camel    文件:DeadEventListener.java   
@Subscribe
void deadEventReceived(DeadEvent deadEvent);
项目:testeverything    文件:DeadEventSubscriber.java   
@Subscribe
public void handleUnsubscribedEvent(DeadEvent deadEvent){
    System.out.println("No subscribers for "+deadEvent.getEvent());
    deadEvents.add(deadEvent);
}
项目:testeverything    文件:DeadEventSubscriber.java   
public List<DeadEvent> getDeadEvents() {
    return deadEvents;
}
项目:sagetv-miniclient    文件:DesktopBus.java   
public void handleDeadEvent(DeadEvent event) {
    log.warn("Unhandled Event: ", event);
}
项目:fathom    文件:DeadEventsSubscriber.java   
@Subscribe
public void handleUnsubscribedEvent(DeadEvent deadEvent) {
    log.warn("No subscribers for {}", deadEvent.getEvent());
}
项目:booties    文件:LoggingDeadEventListener.java   
@Subscribe
public void handleDeadEvent(final DeadEvent deadEvent) {
    LOG.warn("Ooops, no listener found for this event: {}", deadEvent.getEvent());
    latch.countDown();
}
项目:agate    文件:DeadEventSubscriber.java   
@Subscribe
public void handleDeadEvent(DeadEvent deadEvent) {
  log.error("Event {} from source {} is not handled", deadEvent.getEvent(), deadEvent.getSource());
}
项目:signalk-server-java    文件:SaveProcessor.java   
@Subscribe
public void recordEvent(DeadEvent e) {
    logger.debug("Received dead event" + e.getSource());
}
项目:dohko    文件:DeadEventLoggingHandler.java   
@Subscribe
public void handleDeadEvent(DeadEvent deadEvent)
{
    logger.trace("detected dead event %s", deadEvent.getEvent());
}
项目:mica2    文件:DeadEventSubscriber.java   
@Subscribe
public void handleDeadEvent(DeadEvent deadEvent) {
  log.error("Event {} from source {} is not handled", deadEvent.getEvent(), deadEvent.getSource());
}
项目:colormap-explorer    文件:MyEventBus.java   
@Subscribe
public void onDeadObject(DeadEvent event)
{
    logger.warn("Dead event: " + event.getEvent());
}
项目:kickflip-android-sdk    文件:Broadcaster.java   
@Subscribe
public void onDeadEvent(DeadEvent e) {
    if (VERBOSE) Log.i(TAG, "DeadEvent ");
}
项目:debop4j    文件:EventBusTest.java   
@Subscribe
public void handleDeadEvent(DeadEvent deadEvent) {
    deadEvents.add(deadEvent);
}
项目:debop4j    文件:EventBusListenerTest.java   
@Subscribe
public void listen(DeadEvent event) {
    notDelivered = true;
}
项目:tellets    文件:AuxiliaryProcess.java   
@Subscribe
@AllowConcurrentEvents
public void catchDeadEvent(DeadEvent e)
{
    log.warn("检测到未处理的事件 event:{} source:{}", e.getEvent(), e.getSource());
}
项目:AisAbnormal    文件:BehaviourManagerImpl.java   
@Subscribe
@SuppressWarnings("unused")
public void listen(DeadEvent event) {
    LOG.trace("No subscribers were interested in this event: " + event.getEvent());
}
项目:StudyGuide    文件:DeadEventListener.java   
/**
 * Listen to dead events and log them.
 *
 * @param event the dead event
 */
@Subscribe
private void listen(DeadEvent event) {
    logger.error("Dead event ({}) pushed from ({})", event.getEvent(), event.getSource());
}
项目:books    文件:DeadEventListener.java   
/**
 * Process every dead event.
 * 
 * @param deadEvent Catchall event
 */
@Subscribe
public void onDeadEvent(DeadEvent deadEvent) {
    log.error("Dead event catched: " + deadEvent.toString());
}