All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.serenitybdd.core.eventbus.Broadcaster Maven / Gradle / Ivy

There is a newer version: 4.2.1
Show newest version
package net.serenitybdd.core.eventbus;

import com.google.common.eventbus.EventBus;

public class Broadcaster {

    static private ThreadLocal eventBusThreadLocal = new ThreadLocal<>();

    public static EventBus getEventBus() {
        if (eventBusThreadLocal.get() == null) {
            eventBusThreadLocal.set(new EventBus());
        }
        return eventBusThreadLocal.get();
    }

    public static void unregisterAllListeners() {
        eventBusThreadLocal.remove();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy