public abstract class AnnotationListenerMethodProcessor<A extends Annotation> extends Object implements org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
| 限定符和类型 | 字段和说明 |
|---|---|
private Class<A> |
annotationType |
protected org.slf4j.Logger |
logger |
| 构造器和说明 |
|---|
AnnotationListenerMethodProcessor() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected boolean |
isCandidateMethod(Object bean,
Class<?> beanClass,
A annotation,
Method method,
org.springframework.context.ApplicationContext applicationContext)
Subclass could override this method to determine current method is candidate or not
|
(专用程序包) static boolean |
isListenerMethod(Method method)
Must be
public
not static
not abstract
not native
void
|
void |
onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event) |
private void |
processBean(String beanName,
Object bean,
Class<?> beanClass,
org.springframework.context.ApplicationContext applicationContext)
Select those methods from bean that annotated.
|
private void |
processBeans(org.springframework.context.ApplicationContext applicationContext) |
private void |
processBeans(Map<String,Object> beansMap,
org.springframework.context.ApplicationContext applicationContext) |
protected abstract void |
processListenerMethod(String beanName,
Object bean,
Class<?> beanClass,
A annotation,
Method method,
org.springframework.context.ApplicationContext applicationContext)
Process Listener Method when
isCandidateMethod(Object, Class, Annotation, Method, ApplicationContext)
returns true |
protected final org.slf4j.Logger logger
private final Class<A extends Annotation> annotationType
static boolean isListenerMethod(Method method)
publicstaticabstractnativevoidmethod - Methodtruepublic final void onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)
onApplicationEvent 在接口中 org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>private void processBeans(org.springframework.context.ApplicationContext applicationContext)
private void processBeans(Map<String,Object> beansMap, org.springframework.context.ApplicationContext applicationContext)
private void processBean(String beanName, Object bean, Class<?> beanClass, org.springframework.context.ApplicationContext applicationContext)
beanName - Bean namebean - Bean objectbeanClass - the Class of BeanapplicationContext - the ApplicationContextprotected abstract void processListenerMethod(String beanName, Object bean, Class<?> beanClass, A annotation, Method method, org.springframework.context.ApplicationContext applicationContext)
isCandidateMethod(Object, Class, Annotation, Method, ApplicationContext)
returns truebeanName - Bean namebean - Bean objectbeanClass - Bean Classannotation - Annotation objectmethod - MethodapplicationContext - ApplicationContextprotected boolean isCandidateMethod(Object bean, Class<?> beanClass, A annotation, Method method, org.springframework.context.ApplicationContext applicationContext)
bean - Bean objectbeanClass - Bean Classannotation - Annotation objectmethod - MethodapplicationContext - ApplicationContexttrue as defaultCopyright © 2021 Zodiac. All rights reserved.