Coverage Summary for Class: AsyncEventBus (com.google.common.eventbus)

Class Class, % Method, % Line, %
AsyncEventBus 0% (0/1) 0% (0/3) 0% (0/3)


1 /* 2  * Copyright (C) 2007 The Guava Authors 3  * 4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5  * in compliance with the License. You may obtain a copy of the License at 6  * 7  * http://www.apache.org/licenses/LICENSE-2.0 8  * 9  * Unless required by applicable law or agreed to in writing, software distributed under the License 10  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11  * or implied. See the License for the specific language governing permissions and limitations under 12  * the License. 13  */ 14  15 package com.google.common.eventbus; 16  17 import java.util.concurrent.Executor; 18  19 /** 20  * An {@link EventBus} that takes the Executor of your choice and uses it to dispatch events, 21  * allowing dispatch to occur asynchronously. 22  * 23  * @author Cliff Biffle 24  * @since 10.0 25  */ 26 @ElementTypesAreNonnullByDefault 27 public class AsyncEventBus extends EventBus { 28  29  /** 30  * Creates a new AsyncEventBus that will use {@code executor} to dispatch events. Assigns {@code 31  * identifier} as the bus's name for logging purposes. 32  * 33  * @param identifier short name for the bus, for logging purposes. 34  * @param executor Executor to use to dispatch events. It is the caller's responsibility to shut 35  * down the executor after the last event has been posted to this event bus. 36  */ 37  public AsyncEventBus(String identifier, Executor executor) { 38  super(identifier, executor, Dispatcher.legacyAsync(), LoggingHandler.INSTANCE); 39  } 40  41  /** 42  * Creates a new AsyncEventBus that will use {@code executor} to dispatch events. 43  * 44  * @param executor Executor to use to dispatch events. It is the caller's responsibility to shut 45  * down the executor after the last event has been posted to this event bus. 46  * @param subscriberExceptionHandler Handler used to handle exceptions thrown from subscribers. 47  * See {@link SubscriberExceptionHandler} for more information. 48  * @since 16.0 49  */ 50  public AsyncEventBus(Executor executor, SubscriberExceptionHandler subscriberExceptionHandler) { 51  super("default", executor, Dispatcher.legacyAsync(), subscriberExceptionHandler); 52  } 53  54  /** 55  * Creates a new AsyncEventBus that will use {@code executor} to dispatch events. 56  * 57  * @param executor Executor to use to dispatch events. It is the caller's responsibility to shut 58  * down the executor after the last event has been posted to this event bus. 59  */ 60  public AsyncEventBus(Executor executor) { 61  super("default", executor, Dispatcher.legacyAsync(), LoggingHandler.INSTANCE); 62  } 63 }