public class BackgroundListenerManager extends ThreadedListenerManager
This class is useful for logging listeners or any other listener that needs to process events one at a time instead of simultaneously.
To mark a listener as a background listener, use addListener(org.pircbotx.hooks.Listener, boolean)
with isBackground set to true
ThreadedListenerManager.ManagedFutureTask
Constructor and Description |
---|
BackgroundListenerManager() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(Listener listener,
boolean isBackground) |
com.google.common.collect.ImmutableSet<Listener> |
getListeners()
Gets all listeners that are in this ListenerManager
|
void |
onEvent(Event event)
Sends event to all appropriate listeners.
|
boolean |
removeListener(Listener listener)
Remove a listener from this ListenerManager
|
addListener, listenerExists, shutdown, shutdown
public void addListener(Listener listener, boolean isBackground)
public void onEvent(Event event)
ListenerManager
onEvent
in interface ListenerManager
onEvent
in class ThreadedListenerManager
event
- The event to sendpublic com.google.common.collect.ImmutableSet<Listener> getListeners()
ListenerManager
getListeners
in interface ListenerManager
getListeners
in class ThreadedListenerManager
public boolean removeListener(Listener listener)
ListenerManager
removeListener
in interface ListenerManager
removeListener
in class ThreadedListenerManager
listener
- The listener to removeCopyright © 2010–2020 Leon Blakey. All rights reserved.