Interface IDhApiEventInjector
- All Superinterfaces:
IDependencyInjector<IDhApiEvent>
- All Known Implementing Classes:
ApiEventInjector
This class takes care of dependency injection for API events.
- Since:
- API 1.0.0
-
Method Summary
Modifier and TypeMethodDescription<T,
U extends IDhApiEvent<T>>
booleanfireAllEvents
(Class<U> abstractEvent, T eventParameterObject) Fires all bound events of the given type (does nothing if no events are bound).boolean
unbind
(Class<? extends IDhApiEvent> dependencyInterface, Class<? extends IDhApiEvent> dependencyClassToRemove) Unlinks the given event handler, preventing the handler from being called in the future.Methods inherited from interface com.seibel.distanthorizons.coreapi.interfaces.dependencyInjection.IDependencyInjector
bind, checkIfClassExtends, checkIfClassImplements, clear, get, get, getAll, runDelayedSetup
-
Method Details
-
unbind
boolean unbind(Class<? extends IDhApiEvent> dependencyInterface, Class<? extends IDhApiEvent> dependencyClassToRemove) throws IllegalArgumentException Unlinks the given event handler, preventing the handler from being called in the future.- Parameters:
dependencyInterface
- the base interface for theIDhApiEvent
dependencyClassToRemove
- the concreteIDhApiEvent
class to remove- Returns:
- true if the handler was unbound, false if the handler wasn't bound.
- Throws:
IllegalArgumentException
- if the implementation object doesn't implement the interface
-
fireAllEvents
Fires all bound events of the given type (does nothing if no events are bound).- Type Parameters:
T
- the parameter type taken by the event handlers.U
- theIDhApiEvent
's class- Parameters:
abstractEvent
- event typeeventParameterObject
- event parameter- Returns:
- if any of the bound event handlers notified that this event should be canceled.
-