public class AnnotationCommandHandlerBeanPostProcessor extends AbstractAnnotationHandlerBeanPostProcessor<CommandHandler,AnnotationCommandHandlerAdapter>
CommandHandler
annotated methods.Constructor and Description |
---|
AnnotationCommandHandlerBeanPostProcessor() |
Modifier and Type | Method and Description |
---|---|
protected Class<CommandHandler> |
getAdapterInterface()
Returns the interface that the adapter implements to connect the annotated method to the actual interface
definition.
|
protected AnnotationCommandHandlerAdapter |
initializeAdapterFor(Object bean,
ParameterResolverFactory parameterResolverFactory)
Create an AnnotationEventListenerAdapter instance of the given
bean . |
protected boolean |
isPostProcessingCandidate(Class<?> targetClass)
Indicates whether an object of the given
targetClass should be post processed. |
void |
setCommandBus(CommandBus commandBus)
Sets the event bus to which detected event listeners should be subscribed.
|
protected void |
subscribe(CommandHandler bean,
AnnotationCommandHandlerAdapter adapter)
Subscribe the given proxy
bean (with its annotated methods managed by given adapter )
to the messaging infrastructure. |
protected void |
unsubscribe(CommandHandler bean,
AnnotationCommandHandlerAdapter adapter)
Unsubscribe the given proxy
bean (with its annotated methods managed by given adapter )
to the messaging infrastructure. |
getApplicationContext, getPhase, isAutoStartup, isRunning, postProcessAfterInitialization, postProcessBeforeDestruction, postProcessBeforeInitialization, setApplicationContext, setParameterResolverFactory, setPhase, setUnsubscribeOnShutdown, start, stop, stop
public AnnotationCommandHandlerBeanPostProcessor()
protected Class<CommandHandler> getAdapterInterface()
AbstractAnnotationHandlerBeanPostProcessor
getAdapterInterface
in class AbstractAnnotationHandlerBeanPostProcessor<CommandHandler,AnnotationCommandHandlerAdapter>
protected boolean isPostProcessingCandidate(Class<?> targetClass)
AbstractAnnotationHandlerBeanPostProcessor
targetClass
should be post processed.isPostProcessingCandidate
in class AbstractAnnotationHandlerBeanPostProcessor<CommandHandler,AnnotationCommandHandlerAdapter>
targetClass
- The type of beanprotected AnnotationCommandHandlerAdapter initializeAdapterFor(Object bean, ParameterResolverFactory parameterResolverFactory)
AbstractAnnotationHandlerBeanPostProcessor
bean
. This adapter will receive all event
handler calls to be handled by this bean.initializeAdapterFor
in class AbstractAnnotationHandlerBeanPostProcessor<CommandHandler,AnnotationCommandHandlerAdapter>
bean
- The bean that the EventListenerAdapter has to adaptparameterResolverFactory
- The parameter resolver factory that provides the parameter resolvers for the
annotated handlersbean
protected void subscribe(CommandHandler bean, AnnotationCommandHandlerAdapter adapter)
AbstractAnnotationHandlerBeanPostProcessor
bean
(with its annotated methods managed by given adapter
)
to the messaging infrastructure.subscribe
in class AbstractAnnotationHandlerBeanPostProcessor<CommandHandler,AnnotationCommandHandlerAdapter>
bean
- The bean to subscribeadapter
- The adapter wrapping the beanprotected void unsubscribe(CommandHandler bean, AnnotationCommandHandlerAdapter adapter)
AbstractAnnotationHandlerBeanPostProcessor
bean
(with its annotated methods managed by given adapter
)
to the messaging infrastructure.unsubscribe
in class AbstractAnnotationHandlerBeanPostProcessor<CommandHandler,AnnotationCommandHandlerAdapter>
bean
- The bean to unsubscribeadapter
- The adapter wrapping the beanpublic void setCommandBus(CommandBus commandBus)
commandBus
- the event bus to subscribe detected event listeners toCopyright © 2010-2014. All Rights Reserved.