public class AnnotationEventListenerAdapter extends Object implements EventListenerProxy
EventHandler
annotated methods into an EventListener
.EventListener
Constructor and Description |
---|
AnnotationEventListenerAdapter(Object annotatedEventListener)
Wraps the given
annotatedEventListener , allowing it to be subscribed to an Event Bus. |
AnnotationEventListenerAdapter(Object annotatedEventListener,
ParameterResolverFactory parameterResolverFactory)
Wraps the given
annotatedEventListener , allowing it to be subscribed to an Event Bus. |
Modifier and Type | Method and Description |
---|---|
boolean |
canHandle(EventMessage<?> event)
Indicates whether this listener can handle the given event message
|
Class<?> |
getTargetType()
Returns the instance type that this proxy delegates all event handling to.
|
void |
handle(EventMessage<?> event)
Process the given event.
|
public AnnotationEventListenerAdapter(Object annotatedEventListener)
annotatedEventListener
, allowing it to be subscribed to an Event Bus.annotatedEventListener
- the annotated event listenerpublic AnnotationEventListenerAdapter(Object annotatedEventListener, ParameterResolverFactory parameterResolverFactory)
annotatedEventListener
, allowing it to be subscribed to an Event Bus. The given
parameterResolverFactory
is used to resolve parameter values for handler methods.annotatedEventListener
- the annotated event listenerparameterResolverFactory
- the strategy for resolving handler method parameter valuespublic void handle(EventMessage<?> event) throws Exception
EventListener
handle
in interface EventListener
event
- the event to handleException
- when an exception is raised during event handlingpublic boolean canHandle(EventMessage<?> event)
EventListener
canHandle
in interface EventListener
event
- The event message to verifytrue
if this listener can handle the event, otherwise false
public Class<?> getTargetType()
EventListenerProxy
getTargetType
in interface EventListenerProxy
Copyright © 2010–2017. All rights reserved.