Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright (c) 2007-2012 Sonatype, Inc. All rights reserved.
  * This program is licensed to you under the Apache License Version 2.0,
  * and you may not use this file except in compliance with the Apache License Version 2.0.
  * You may obtain a copy of the Apache License Version 2.0 at
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the Apache License Version 2.0 is distributed on an
 * See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
package org.sonatype.sisu.goodies.eventbus.internal;
A Guava org.sonatype.sisu.goodies.eventbus.internal.guava.EventBus that differs from default one by dispatching events as they appear (is re-entrant). Guava will queue up all event and dispatch them in the order they were posted, without re-entrance.

    extends DefaultGuavaEventBus

List of events for the current thread to dispatch
  protected void enqueueEvent(final Object eventfinal EventHandler handler) {
    if (.get() == null) {
    .get().add(new EventWithHandler(eventhandler));
  protected void dispatchQueuedEvents() {
    final List<EventWithHandlereventWithHandlers = .get();
    if (eventWithHandlers != null) {
      for (final EventWithHandler eventWithHandler : eventWithHandlers) {
  public String toString() {
    return "Reentrant Guava EventBus";
New to GrepCode? Check out our FAQ X