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
EventListenerhandle in interface EventListenerevent - the event to handleException - when an exception is raised during event handlingpublic boolean canHandle(EventMessage<?> event)
EventListenercanHandle in interface EventListenerevent - The event message to verifytrue if this listener can handle the event, otherwise falsepublic Class<?> getTargetType()
EventListenerProxygetTargetType in interface EventListenerProxypublic void prepareReset()
EventListenerprepareReset in interface EventListenerpublic boolean supportsReset()
EventListenersupportsReset in interface EventListenertrue if a reset is supported, otherwise falseCopyright © 2010–2018. All rights reserved.