IEventManager
public class InterfacedEventManager extends java.lang.Object implements IEventManager
IEventManager
implementation
that uses the EventListener
interface for
event listeners.
This only accepts listeners that implement EventListener
An adapter implementation is ListenerAdapter
which
provides methods for each individual Event
.
This is the default IEventManager used by JDA
AnnotatedEventManager
,
IEventManager
Constructor | Description |
---|---|
InterfacedEventManager() |
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
|
public void register(java.lang.Object listener)
register
in interface IEventManager
listener
- A listener objectjava.lang.IllegalArgumentException
- If the provided listener does not implement EventListener
public void unregister(java.lang.Object listener)
IEventManager
unregister
in interface IEventManager
listener
- The listener object to removepublic java.util.List<java.lang.Object> getRegisteredListeners()
IEventManager
getRegisteredListeners
in interface IEventManager
public void handle(Event event)
IEventManager
Event
.
How this is handled is specified by the implementation.handle
in interface IEventManager
event
- The event to handle