Code example for EventBus

0
     *  
     * @return Async event bus 
     */ 
    private EventBus newAsyncEventBus() {
        if (EnvironmentUtil.isUnitTest()) { 
            return new EventBus();
        } else { 
            ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1,
                    0L, TimeUnit.MILLISECONDS,
                    new LinkedBlockingQueue<Runnable>());
            asyncExecutorList.add(executor);
            return new AsyncEventBus(executor);
        } 
    } 
 
    /** 
     * Getter of eventBus. 
     * 
     * @return eventBus 
     */