Package net.dv8tion.jda.api.hooks
Interface IEventManager
-
- All Known Implementing Classes:
AnnotatedEventManager,InterfacedEventManager
public interface IEventManagerAn interface for JDA's EventManager system.
This should be registered in theJDABuilderJDA provides 2 implementations:
InterfacedEventManager
Simple implementation that allowsEventListenerinstances as listeners.AnnotatedEventManager
An implementation that accepts any object and uses theSubscribeEventannotation to handle events.
The default event manager is
InterfacedEventManager
UseJDABuilder.setEventManager(IEventManager)to set the preferred event manager implementation.
You can only use one implementation per JDA instance!- See Also:
InterfacedEventManager,AnnotatedEventManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<Object>getRegisteredListeners()The currently registered listenersvoidhandle(GenericEvent event)Handles the providedGenericEvent.voidregister(Object listener)Registers the specified listener
Accepted types may be specified by implementationsvoidunregister(Object listener)Removes the specified listener
-
-
-
Method Detail
-
register
void register(@Nonnull Object listener)
Registers the specified listener
Accepted types may be specified by implementations- Parameters:
listener- A listener object
-
unregister
void unregister(@Nonnull Object listener)
Removes the specified listener- Parameters:
listener- The listener object to remove
-
handle
void handle(@Nonnull GenericEvent event)
Handles the providedGenericEvent. How this is handled is specified by the implementation.- Parameters:
event- The event to handle
-
-