AnnotatedEventManager
, InterfacedEventManager
public interface IEventManager
JDABuilder
JDA provides 2 implementations:
InterfacedEventManager
EventListener
instances as listeners.AnnotatedEventManager
SubscribeEvent
annotation to handle events.The default event manager is InterfacedEventManager
Use JDABuilder.setEventManager(IEventManager)
to set the preferred event manager implementation.
You can only use one implementation per JDA instance!
InterfacedEventManager
,
AnnotatedEventManager
Modifier and Type | Method | Description |
---|---|---|
java.util.List<java.lang.Object> |
getRegisteredListeners() |
The currently registered listeners
|
void |
handle(Event event) |
Handles the provided
Event . |
void |
register(java.lang.Object listener) |
Registers the specified listener
Accepted types may be specified by implementations |
void |
unregister(java.lang.Object listener) |
Removes the specified listener
|
void register(java.lang.Object listener)
listener
- A listener objectvoid unregister(java.lang.Object listener)
listener
- The listener object to removevoid handle(Event event)
Event
.
How this is handled is specified by the implementation.event
- The event to handlejava.util.List<java.lang.Object> getRegisteredListeners()