I - The primary interface of the adapter being createdT - The type of adapter created by this classpublic abstract class AbstractAnnotationHandlerBeanPostProcessor<I,T extends I> extends Object implements org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor, org.springframework.context.ApplicationContextAware, org.springframework.context.SmartLifecycle
| Constructor and Description |
|---|
AbstractAnnotationHandlerBeanPostProcessor() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Class<I> |
getAdapterInterface()
Returns the interface that the adapter implements to connect the annotated method to the actual interface
definition.
|
protected org.springframework.context.ApplicationContext |
getApplicationContext()
Returns the ApplicationContext this Bean Post Processor is registered in.
|
int |
getPhase() |
protected abstract T |
initializeAdapterFor(Object bean,
ParameterResolverFactory parameterResolverFactory)
Create an AnnotationEventListenerAdapter instance of the given
bean. |
boolean |
isAutoStartup() |
protected abstract boolean |
isPostProcessingCandidate(Class<?> targetClass)
Indicates whether an object of the given
targetClass should be post processed. |
boolean |
isRunning() |
Object |
postProcessAfterInitialization(Object bean,
String beanName) |
void |
postProcessBeforeDestruction(Object bean,
String beanName) |
Object |
postProcessBeforeInitialization(Object bean,
String beanName) |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setParameterResolverFactory(ParameterResolverFactory parameterResolverFactory)
Sets the ParameterResolverFactory to create the Parameter Resolvers with that provide the parameter values for
the handler methods.
|
void |
setPhase(int phase)
Sets the phase in which handlers are subscribed and unsubscribed.
|
void |
setUnsubscribeOnShutdown(boolean unsubscribeOnShutdown)
Indicates whether handlers should be unsubscribed on shutdown.
|
void |
start() |
void |
stop() |
void |
stop(Runnable callback) |
protected abstract void |
subscribe(I bean,
T adapter)
Subscribe the given proxy
bean (with its annotated methods managed by given adapter)
to the messaging infrastructure. |
protected abstract void |
unsubscribe(I bean,
T adapter)
Unsubscribe the given proxy
bean (with its annotated methods managed by given adapter)
to the messaging infrastructure. |
public AbstractAnnotationHandlerBeanPostProcessor()
public Object postProcessBeforeInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException
postProcessBeforeInitialization in interface org.springframework.beans.factory.config.BeanPostProcessororg.springframework.beans.BeansExceptionpublic Object postProcessAfterInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException
postProcessAfterInitialization in interface org.springframework.beans.factory.config.BeanPostProcessororg.springframework.beans.BeansExceptionprotected abstract Class<I> getAdapterInterface()
protected abstract boolean isPostProcessingCandidate(Class<?> targetClass)
targetClass should be post processed.targetClass - The type of beanpublic boolean isAutoStartup()
isAutoStartup in interface org.springframework.context.SmartLifecyclepublic void stop(Runnable callback)
stop in interface org.springframework.context.SmartLifecyclepublic void start()
start in interface org.springframework.context.Lifecyclepublic void stop()
stop in interface org.springframework.context.Lifecyclepublic boolean isRunning()
isRunning in interface org.springframework.context.Lifecyclepublic int getPhase()
getPhase in interface org.springframework.context.Phasedpublic void setPhase(int phase)
phase - The phase in which handlers are subscribed and unsubscribedpublic void postProcessBeforeDestruction(Object bean, String beanName) throws org.springframework.beans.BeansException
postProcessBeforeDestruction in interface org.springframework.beans.factory.config.DestructionAwareBeanPostProcessororg.springframework.beans.BeansExceptionprotected abstract void subscribe(I bean, T adapter)
bean (with its annotated methods managed by given adapter)
to the messaging infrastructure.bean - The bean to subscribeadapter - The adapter wrapping the beanprotected abstract void unsubscribe(I bean, T adapter)
bean (with its annotated methods managed by given adapter)
to the messaging infrastructure.bean - The bean to unsubscribeadapter - The adapter wrapping the beanprotected abstract T initializeAdapterFor(Object bean, ParameterResolverFactory parameterResolverFactory)
bean. This adapter will receive all event
handler calls to be handled by this bean.bean - The bean that the EventListenerAdapter has to adaptparameterResolverFactory - The parameter resolver factory that provides the parameter resolvers for the
annotated handlersbeanprotected org.springframework.context.ApplicationContext getApplicationContext()
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic void setUnsubscribeOnShutdown(boolean unsubscribeOnShutdown)
true.unsubscribeOnShutdown - true to unsubscribe beans explicitly from their command/event bus or
false to shutdown without unsubscribing explicitly.public void setParameterResolverFactory(ParameterResolverFactory parameterResolverFactory)
parameterResolverFactory - The parameter resolver factory to resolve parameter values withCopyright © 2010-2014. All Rights Reserved.