public class DefaultEventManager extends Object implements EventManager
EventManager
.Modifier and Type | Class and Description |
---|---|
static class |
DefaultEventManager.Exceptional
Exception handler.
|
Constructor and Description |
---|
DefaultEventManager(@NonNull Client client)
Constructs the event manager.
|
Modifier and Type | Method and Description |
---|---|
void |
callEvent(@NonNull Object event)
Calls an event, triggering any registered methods for the event class.
|
@NonNull Map<Class<? extends Annotation>,FilterProcessor<?,? extends Annotation>> |
getAnnotationFilters()
Gets a map of all registered annotation filters.
|
@NonNull Set<Object> |
getRegisteredEventListeners()
Gets all registered listener objects.
|
void |
onShutdown(ClientConnectionEndedEvent event)
Just the manager listening for shutdown, don't worry about it.
|
<A extends Annotation> |
registerAnnotationFilter(Class<A> annotationClass,
FilterProcessor<?,A> filterProcessor)
Registers an annotation to be used in filtering events if present on
a handler method.
|
void |
registerEventListener(@NonNull Object listener)
Registers annotated with
Handler with sync invocation,
provided they have a single parameter. |
@NonNull String |
toString() |
void |
unregisterEventListener(@NonNull Object listener)
Unregisters a listener.
|
public DefaultEventManager(@NonNull Client client)
client
- client for which this manager will operatepublic void callEvent(@NonNull Object event)
EventManager
callEvent
in interface EventManager
event
- event to callpublic @NonNull Set<Object> getRegisteredEventListeners()
EventManager
getRegisteredEventListeners
in interface EventManager
public @NonNull Map<Class<? extends Annotation>,FilterProcessor<?,? extends Annotation>> getAnnotationFilters()
EventManager
getAnnotationFilters
in interface EventManager
public <A extends Annotation> void registerAnnotationFilter(Class<A> annotationClass, FilterProcessor<?,A> filterProcessor)
EventManager
registerAnnotationFilter
in interface EventManager
A
- annotation typeannotationClass
- annotation to registerfilterProcessor
- filter processor to process such annotationspublic void registerEventListener(@NonNull Object listener)
EventManager
Handler
with sync invocation,
provided they have a single parameter. This parameter is the event.registerEventListener
in interface EventManager
listener
- listener in which to register eventspublic void unregisterEventListener(@NonNull Object listener)
EventManager
unregisterEventListener
in interface EventManager
listener
- listener to unregisterpublic void onShutdown(ClientConnectionEndedEvent event)
event
- event of doomCopyright © 2013–2021 Kitteh. All rights reserved.