/*
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.beans.factory.support;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.beans.BeansException;
import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.PropertyAccessorUtils;
import org.springframework.beans.PropertyValue;
import org.springframework.beans.PropertyValues;
import org.springframework.beans.TypeConverter;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.BeanCurrentlyInCreationException;
import org.springframework.beans.factory.BeanDefinitionStoreException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.UnsatisfiedDependencyException;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.beans.factory.config.DependencyDescriptor;
import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor;
import org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor;
import org.springframework.beans.factory.config.TypedStringValue;
import org.springframework.core.MethodParameter;
import org.springframework.core.ParameterNameDiscoverer;
import org.springframework.core.PriorityOrdered;
import org.springframework.util.ClassUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.ReflectionUtils;
import org.springframework.util.StringUtils;
/**
* Abstract bean factory superclass that implements default bean creation,
* with the full capabilities specified by the {@link RootBeanDefinition} class.
* Implements the {@link org.springframework.beans.factory.config.AutowireCapableBeanFactory}
* interface in addition to AbstractBeanFactory's {@link #createBean} method.
*
* <p>Provides bean creation (with constructor resolution), property population,
* wiring (including autowiring), and initialization. Handles runtime bean
* references, resolves managed collections, calls initialization methods, etc.
* Supports autowiring constructors, properties by name, and properties by type.
*
* <p>The main template method to be implemented by subclasses is
* {@link #resolveDependency(DependencyDescriptor, String, Set, TypeConverter)},
* used for autowiring by type. In case of a factory which is capable of searching
* its bean definitions, matching beans will typically be implemented through such
* a search. For other factory styles, simplified matching algorithms can be implemented.
*
* <p>Note that this class does <i>not</i> assume or implement bean definition
* registry capabilities. See {@link DefaultListableBeanFactory} for an implementation
* of the {@link org.springframework.beans.factory.ListableBeanFactory} and
* {@link BeanDefinitionRegistry} interfaces, which represent the API and SPI
* view of such a factory, respectively.
*
* @author Rod Johnson
* @author Juergen Hoeller
* @author Rob Harrop
* @author Mark Fisher
* @author Costin Leau
* @since 13.02.2004
* @see RootBeanDefinition
* @see DefaultListableBeanFactory
* @see BeanDefinitionRegistry
*/
public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFactory
implements AutowireCapableBeanFactory {
/** Strategy for creating bean instances */
private InstantiationStrategy instantiationStrategy = new CglibSubclassingInstantiationStrategy();
/** Resolver strategy for method parameter names */
private ParameterNameDiscoverer parameterNameDiscoverer;
/** Whether to automatically try to resolve circular references between beans */
private boolean allowCircularReferences = true;
/**
* Whether to resort to injecting a raw bean instance in case of circular reference,
* even if the injected bean eventually got wrapped.
*/
private boolean allowRawInjectionDespiteWrapping = false;
/**
* Dependency types to ignore on dependency check and autowire, as Set of
* Class objects: for example, String. Default is none.
*/
private final Set<Class> ignoredDependencyTypes = new HashSet<Class>();
/**
* Dependency interfaces to ignore on dependency check and autowire, as Set of
* Class objects. By default, only the BeanFactory interface is ignored.
*/
private final Set<Class> ignoredDependencyInterfaces = new HashSet<Class>();
/** Cache of unfinished FactoryBean instances: FactoryBean name --> BeanWrapper */
private final Map<String, BeanWrapper> factoryBeanInstanceCache =
new ConcurrentHashMap<String, BeanWrapper>();
/** Cache of filtered PropertyDescriptors: bean Class -> PropertyDescriptor array */
private final Map<Class, PropertyDescriptor[]> filteredPropertyDescriptorsCache =
new HashMap<Class, PropertyDescriptor[]>();
/**
* Create a new AbstractAutowireCapableBeanFactory.
*/
public AbstractAutowireCapableBeanFactory() {
super();
ignoreDependencyInterface(BeanNameAware.class);
ignoreDependencyInterface(BeanFactoryAware.class);
ignoreDependencyInterface(BeanClassLoaderAware.class);
}
/**
* Create a new AbstractAutowireCapableBeanFactory with the given parent.
* @param parentBeanFactory parent bean factory, or <code>null</code> if none
*/
public AbstractAutowireCapableBeanFactory(BeanFactory parentBeanFactory) {
this();
setParentBeanFactory(parentBeanFactory);
}
/**
* Set the instantiation strategy to use for creating bean instances.
* Default is CglibSubclassingInstantiationStrategy.
* @see CglibSubclassingInstantiationStrategy
*/
public void setInstantiationStrategy(InstantiationStrategy instantiationStrategy) {
this.instantiationStrategy = instantiationStrategy;
}
/**
* Return the instantiation strategy to use for creating bean instances.
*/
protected InstantiationStrategy getInstantiationStrategy() {
return this.instantiationStrategy;
}
/**
* Set the ParameterNameDiscoverer to use for resolving method parameter
* names if needed (e.g. for constructor names).
* <p>Default is none. A typical candidate
没有合适的资源?快使用搜索试试~ 我知道了~
spring 3 all
共2727个文件
java:2703个
aj:12个
html:3个
4星 · 超过85%的资源 需积分: 9 19 下载量 89 浏览量
2010-11-15
20:58:21
上传
评论
收藏 4.24MB RAR 举报
温馨提示
自己分析的spring 3源代码,为了方便同学们学习下载,希望大学喜欢
资源推荐
资源详情
资源评论
收起资源包目录
spring 3 all (2727个子文件)
AbstractMethodMockingControl.aj 6KB
AbstractInterfaceDrivenDependencyInjectionAspect.aj 6KB
AbstractTransactionAspect.aj 4KB
AnnotationBeanConfigurerAspect.aj 3KB
AbstractDependencyInjectionAspect.aj 3KB
AnnotationTransactionAspect.aj 3KB
AnnotationDrivenStaticEntityMockingControl.aj 3KB
AbstractBeanConfigurerAspect.aj 3KB
AbstractAsyncExecutionAspect.aj 2KB
AnnotationAsyncExecutionAspect.aj 2KB
GenericInterfaceDrivenDependencyInjectionAspect.aj 2KB
JpaExceptionTranslatorAspect.aj 796B
spring.ftl 13KB
SpringExpressions.g 6KB
package.html 545B
package.html 84B
package.html 84B
AbstractAutowireCapableBeanFactory.java 61KB
AbstractBeanFactory.java 61KB
AbstractPlatformTransactionManager.java 55KB
DispatcherPortlet.java 52KB
AbstractApplicationContext.java 52KB
JdbcOperations.java 50KB
BeanDefinitionParserDelegate.java 50KB
JdbcTemplate.java 50KB
JtaTransactionManager.java 49KB
AnnotationMethodHandlerAdapter.java 48KB
DispatcherServlet.java 48KB
LocalSessionFactoryBean.java 45KB
HibernateTemplate.java 45KB
MimeMessageHelper.java 44KB
HibernateOperations.java 44KB
MBeanExporter.java 43KB
DefaultMessageListenerContainer.java 42KB
BeanWrapperImpl.java 42KB
AbstractFormController.java 42KB
ClassUtils.java 41KB
DefaultListableBeanFactory.java 39KB
HibernateTransactionManager.java 38KB
StringUtils.java 37KB
AbstractWizardFormController.java 37KB
JmsTemplate.java 36KB
SessionFactoryUtils.java 35KB
HandlerMethodInvoker.java 34KB
AbstractBeanDefinition.java 34KB
ConstructorResolver.java 34KB
AnnotationMethodHandlerAdapter.java 34KB
AbstractJasperReportsView.java 33KB
Cglib2AopProxy.java 31KB
AbstractFormController.java 31KB
PersistenceAnnotationBeanPostProcessor.java 30KB
WebUtils.java 29KB
FrameworkServlet.java 29KB
RequestContext.java 28KB
AbstractWizardFormController.java 28KB
CommonAnnotationBeanPostProcessor.java 28KB
PathMatchingResourcePatternResolver.java 28KB
InternalSpelExpressionParser.java 28KB
SchedulerFactoryBean.java 28KB
RestTemplate.java 28KB
AspectJAdviceParameterNameDiscoverer.java 28KB
AbstractMessageListenerContainer.java 27KB
Jaxb2Marshaller.java 26KB
FrameworkPortlet.java 26KB
JaxRpcPortClientInterceptor.java 26KB
MediaType.java 26KB
JpaTransactionManager.java 26KB
DataBinder.java 26KB
BaseCommandController.java 26KB
NamedParameterJdbcOperations.java 25KB
MessageListenerAdapter.java 25KB
MultiActionController.java 25KB
ObjectUtils.java 25KB
ProxyFactoryBean.java 24KB
BeanUtils.java 24KB
SimpleFormController.java 24KB
JdoTransactionManager.java 24KB
TypeConverterDelegate.java 24KB
AbstractAspectJAdvice.java 24KB
ReloadableResourceBundleMessageSource.java 23KB
PortletRequestUtils.java 23KB
PropertyEditorRegistrySupport.java 23KB
SimpleJdbcOperations.java 23KB
SingletonBeanFactoryLocator.java 23KB
ServletRequestUtils.java 23KB
TilesConfigurer.java 23KB
ScriptFactoryPostProcessor.java 23KB
AbstractAutoProxyCreator.java 23KB
MBeanClientInterceptor.java 23KB
AutowiredAnnotationBeanPostProcessor.java 23KB
VelocityView.java 23KB
BaseCommandController.java 23KB
ReflectionUtils.java 22KB
JdoTemplate.java 22KB
AbstractReflectiveMBeanInfoAssembler.java 22KB
MockHttpServletRequest.java 22KB
GenericConversionService.java 22KB
CallMetaDataContext.java 22KB
AbstractXsltView.java 22KB
AbstractJdbcInsert.java 22KB
共 2727 条
- 1
- 2
- 3
- 4
- 5
- 6
- 28
资源评论
- 闹闹的BaBa2013-10-17里面东西挺全的,找了半天没找到,终于在CSDN找到了
yetty2003
- 粉丝: 5
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Python实现的股票量化交易策略源代码+视频讲解+案例代码,含RSI策略、BOP指标策略、KDJ策略、MACD指标策略等
- EDA编码.zip
- 文本分类任务训练神经网络来学习词汇表中每个词的词向量
- MyBatis进阶技巧:探索动态SQL的无限可能.md
- HM2300C-VB一款N-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- HM2300B-VB一款N-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- 员工解除劳动合同申请表.pdf
- 物模块模型代码,前往设计物模块所属
- mybatis动态sql(使用<where>标签来处理多个查询条件)
- Java面试手册,助力大家面试过五关斩六将,面试成功
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功