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

io.magentys.cinnamon.eventbus.EventBusContainer Maven / Gradle / Ivy

There is a newer version: 0.2.0
Show newest version
package io.magentys.cinnamon.eventbus;

import com.google.common.eventbus.EventBus;

public class EventBusContainer {

    private static final ThreadLocal eventBus = new ThreadLocal<>();

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

    public static void removeEventBus() {
        eventBus.remove();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy