public class AnnotationEventHandlerAdapter extends Object implements EventMessageHandler
EventHandler annotated methods into an EventMessageHandler.EventMessageHandler| Constructor and Description |
|---|
AnnotationEventHandlerAdapter(Object annotatedEventListener)
Wraps the given
annotatedEventListener, allowing it to be subscribed to an Event Bus. |
AnnotationEventHandlerAdapter(Object annotatedEventListener,
ParameterResolverFactory parameterResolverFactory)
Wraps the given
annotatedEventListener, allowing it to be subscribed to an Event Bus. |
AnnotationEventHandlerAdapter(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 handler can handle the given message
|
Class<?> |
getTargetType()
Returns the instance type that this handler delegates to.
|
Object |
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 AnnotationEventHandlerAdapter(Object annotatedEventListener)
annotatedEventListener, allowing it to be subscribed to an Event Bus.annotatedEventListener - the annotated event listenerpublic AnnotationEventHandlerAdapter(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 AnnotationEventHandlerAdapter(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 Object handle(EventMessage<?> event) throws Exception
EventMessageHandlerhandle in interface EventMessageHandlerhandle in interface MessageHandler<EventMessage<?>>event - the event to handleException - when an exception is raised during event handlingpublic boolean canHandle(EventMessage<?> event)
MessageHandlercanHandle in interface MessageHandler<EventMessage<?>>event - The message to verifytrue if this handler can handle the message, otherwise falsepublic Class<?> getTargetType()
MessageHandlergetTargetType in interface MessageHandler<EventMessage<?>>public void prepareReset()
EventMessageHandlerprepareReset in interface EventMessageHandlerpublic boolean supportsReset()
EventMessageHandlersupportsReset in interface EventMessageHandlertrue if a reset is supported, otherwise falseCopyright © 2010–2018. All rights reserved.