|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectorg.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
com.baidu.jprotobuf.pbrpc.spring.annotation.CommonAnnotationBeanPostProcessor
public class CommonAnnotationBeanPostProcessor
Common annotation bean post processor. it uses AnnotationParserCallback
interface to define specified Annotation then recognize the Class to do
bean define action
AnnotationParserCallback| 字段摘要 | |
|---|---|
protected static org.apache.commons.logging.Log |
LOGGER
log this class |
| 从接口 org.springframework.core.Ordered 继承的字段 |
|---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
| 构造方法摘要 | |
|---|---|
CommonAnnotationBeanPostProcessor()
|
|
| 方法摘要 | |
|---|---|
void |
afterPropertiesSet()
Initialize propertyResource instance load |
void |
destroy()
Invoke callback destroy method |
int |
getOrder()
get order |
void |
onApplicationEvent(org.springframework.context.ApplicationEvent event)
Do annotation on class type resolve action after spring container started. |
protected void |
parseFields(Class<?> clazz,
List<Class<? extends Annotation>> annotions,
LinkedList<org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement> elements)
To parse all field to find out annotation info |
protected void |
parseMethods(Class<?> clazz,
List<Class<? extends Annotation>> annotions,
LinkedList<org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement> elements)
To parse all method to find out annotation info |
Object |
postProcessBeforeInitialization(Object bean,
String beanName)
To parse all initialized bean from spring which has target annotation matches. |
void |
postProcessMergedBeanDefinition(org.springframework.beans.factory.support.RootBeanDefinition beanDefinition,
Class beanType,
String beanName)
Post-process the given merged bean definition for the specified bean. |
org.springframework.beans.PropertyValues |
postProcessPropertyValues(org.springframework.beans.PropertyValues pvs,
PropertyDescriptor[] pds,
Object bean,
String beanName)
Post-process the given property values before the factory applies them to the given bean. |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance. |
void |
setCallback(AnnotationParserCallback callback)
set callback |
void |
setOrder(int order)
set order |
| 从类 org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter 继承的方法 |
|---|
determineCandidateConstructors, getEarlyBeanReference, postProcessAfterInitialization, postProcessAfterInstantiation, postProcessBeforeInstantiation, predictBeanType |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 从接口 org.springframework.beans.factory.config.BeanPostProcessor 继承的方法 |
|---|
postProcessAfterInitialization |
| 字段详细信息 |
|---|
protected static final org.apache.commons.logging.Log LOGGER
| 构造方法详细信息 |
|---|
public CommonAnnotationBeanPostProcessor()
| 方法详细信息 |
|---|
public void setCallback(AnnotationParserCallback callback)
callback - the callback to setpublic void setOrder(int order)
order - the orderpublic int getOrder()
org.springframework.core.Ordered 中的 getOrder
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
throws org.springframework.beans.BeansException
Invoked after the population of normal bean properties but before an initialization callback such as
InitializingBean.afterPropertiesSet() or a custom init-method.
org.springframework.beans.factory.BeanFactoryAware 中的 setBeanFactorybeanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
org.springframework.beans.BeansException - in case of initialization errorsBeanInitializationException
public Object postProcessBeforeInitialization(Object bean,
String beanName)
throws org.springframework.beans.BeansException
org.springframework.beans.factory.config.BeanPostProcessor 中的 postProcessBeforeInitializationorg.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter 中的 postProcessBeforeInitializationbean - original bean initialize by springbeanName - bean name defined in spring
AnnotationParserCallback
org.springframework.beans.BeansException - in case of initialization errors
public void postProcessMergedBeanDefinition(org.springframework.beans.factory.support.RootBeanDefinition beanDefinition,
Class beanType,
String beanName)
org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor 中的 postProcessMergedBeanDefinitionbeanDefinition - the merged bean definition for the beanbeanType - the actual type of the managed bean instancebeanName - the name of the bean
public org.springframework.beans.PropertyValues postProcessPropertyValues(org.springframework.beans.PropertyValues pvs,
PropertyDescriptor[] pds,
Object bean,
String beanName)
throws org.springframework.beans.BeansException
Also allows for replacing the property values to apply, typically through creating a new MutablePropertyValues instance based on the original PropertyValues, adding or removing specific values.
org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor 中的 postProcessPropertyValuesorg.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter 中的 postProcessPropertyValuespvs - the property values that the factory is about to apply (never null)pds - the relevant property descriptors for the target bean (with ignored dependency types - which the
factory handles specifically - already filtered out)bean - the bean instance created, but whose properties have not yet been setbeanName - the name of the bean
null to skip property population
org.springframework.beans.BeansException - in case of errorsMutablePropertyValues
protected void parseMethods(Class<?> clazz,
List<Class<? extends Annotation>> annotions,
LinkedList<org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement> elements)
clazz - target classannotion - target annotation to findelements - injected element of all methods
protected void parseFields(Class<?> clazz,
List<Class<? extends Annotation>> annotions,
LinkedList<org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement> elements)
clazz - target classannotion - target annotation to findelements - injected element of all fields
public void destroy()
throws Exception
org.springframework.beans.factory.DisposableBean 中的 destroyException - in case of callback do destroy action error
public void afterPropertiesSet()
throws Exception
org.springframework.beans.factory.InitializingBean 中的 afterPropertiesSetException - in case of any errorpublic void onApplicationEvent(org.springframework.context.ApplicationEvent event)
org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent> 中的 onApplicationEventevent - spring application event
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||