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. |
AnnotationEventListenerAdapter(Object annotatedEventListener,
ParameterResolverFactory parameterResolverFactory,
HandlerDefinition handlerDefinition)
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.
|
void |
prepareReset()
Performs any activities that are required to reset the state managed by handlers assigned to this invoker.
|
boolean |
supportsReset()
Indicates whether the handlers managed by this invoker support a reset.
|
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 AnnotationEventListenerAdapter(Object annotatedEventListener, ParameterResolverFactory parameterResolverFactory, HandlerDefinition handlerDefinition)
annotatedEventListener
, allowing it to be subscribed to an Event Bus. The given parameterResolverFactory
is used to resolve parameter values for handler methods. Handler definition is used to
create concrete handlers.annotatedEventListener
- the annotated event listenerparameterResolverFactory
- the strategy for resolving handler method parameter valueshandlerDefinition
- the handler definition used to create concrete handlerspublic 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
public void prepareReset()
EventListener
prepareReset
in interface EventListener
public boolean supportsReset()
EventListener
supportsReset
in interface EventListener
true
if a reset is supported, otherwise false
Copyright © 2010–2018. All rights reserved.