Package org.apache.shiro.event.support
Interface EventListener
-
- All Known Subinterfaces:
TypedEventListener
- All Known Implementing Classes:
SingleArgumentMethodEventListener
public interface EventListenerAn event listener knows how to accept and process events of a particular type (or types). Note that this interface is in the event implementation support package (and not the event package directly) because it is a supporting concept for event bus implementations and not something that most application developers using Shiro should implement directly. App developers should instead use theSubscribeannotation on methods they wish to receive events. This interface therefore mainly represents a 'middle man' between the event bus and the actual subscribing component. As such, event bus implementors (or framework/infrastructural implementors) or those that wish to customize listener/dispatch functionality might find this concept useful. It is a concept almost always used in conjunction with aEventListenerResolverimplementation.- Since:
- 1.3
- See Also:
SingleArgumentMethodEventListener,AnnotationEventListenerResolver
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaccepts(Object event)Returnstrueif the listener instance can process the specified event object,falseotherwise.voidonEvent(Object event)Handles the specified event.
-
-
-
Method Detail
-
accepts
boolean accepts(Object event)
Returnstrueif the listener instance can process the specified event object,falseotherwise.- Parameters:
event- the event object to test- Returns:
trueif the listener instance can process the specified event object,falseotherwise.
-
onEvent
void onEvent(Object event)
Handles the specified event. Again, as this interface is an implementation concept, implementations of this method will likely dispatch the event to a 'real' processor (e.g. method).- Parameters:
event- the event to handle.
-
-