spring源码 继承AttributeAccessor的BeanDefinition接口

/**
* A BeanDefinition describes a bean instance, which has property values,
* constructor argument values, and further information supplied by
* concrete implementations.
*BeanDefinition(bean的定义)描述了bean的实例,它具有属性值,构造函数,等等。。。*/
public interface BeanDefinition extends AttributeAccessor, BeanMetadataElement { /**
* Scope identifier for the standard singleton scope: "singleton".
* <p>Note that extended bean factories might support further scopes.
标准单例范围的范围表示符是:singleton,意思就是单例模式的意思*/
String SCOPE_SINGLETON = ConfigurableBeanFactory.SCOPE_SINGLETON; /**
* Scope identifier for the standard prototype scope: "prototype".
* <p>Note that extended bean factories might support further scopes.
原型模式
*/
String SCOPE_PROTOTYPE = ConfigurableBeanFactory.SCOPE_PROTOTYPE; /**
* Role hint indicating that a {@code BeanDefinition} is a major part
* of the application. Typically corresponds to a user-defined bean.
角色提示表明BeanDefinition是主要部门
*/
int ROLE_APPLICATION = 0; /**
* Role hint indicating that a {@code BeanDefinition} is a supporting
* part of some larger configuration, typically an outer
角色提示证明BeanDefinition是一个支持一些较大配置的一部分。通常是外部配置*/
int ROLE_SUPPORT = 1; /**
* Role hint indicating that a {@code BeanDefinition} is providing an
* entirely background role and has no relevance to the end-user. This hint is
* used when registering beans that are completely part of the internal workings
* of a {@link org.springframework.beans.factory.parsing.ComponentDefinition}.
注册Bean的时候内部工作使用
*/
int ROLE_INFRASTRUCTURE = 2; // Modifiable attributes /**
* Set the name of the parent definition of this bean definition, if any.
如果有的话,设置此bean的父定义的名称
*/
void setParentName(String parentName); /**
* Return the name of the parent definition of this bean definition, if any.
如果有的话,返回此bean定义的父定义的名称
*/
String getParentName(); /**
* Specify the bean class name of this bean definition.
* <p>The class name can be modified during bean factory post-processing,
* typically replacing the original class name with a parsed variant of it.
设置Bean的类全名*/
void setBeanClassName(String beanClassName); /**
* Return the current bean class name of this bean definition.
* <p>Note that this does not have to be the actual class name used at runtime, in
* case of a child definition overriding/inheriting the class name from its parent.
* Also, this may just be the class that a factory method is called on, or it may
* even be empty in case of a factory bean reference that a method is called on.
* Hence, do <i>not</i> consider this to be the definitive bean type at runtime but
* rather only use it for parsing purposes at the individual bean definition level.
返回此bean的类全名。注意,这不一定是运行时使用的实际类全名*/
String getBeanClassName(); /**
* Override the target scope of this bean, specifying a new scope name.
覆盖此bean的目标返回,指定新的范围名称*/
void setScope(String scope); /**
* Return the name of the current target scope for this bean,
返回此bean的当前目标范围的名称*/
String getScope(); /**
* Set whether this bean should be lazily initialized.
* <p>If {@code false}, the bean will get instantiated on startup by bean
* factories that perform eager initialization of singletons.
设置是否应该懒加载此bean
*/
void setLazyInit(boolean lazyInit); /**
* Return whether this bean should be lazily initialized, i.e. not
* eagerly instantiated on startup. Only applicable to a singleton bean.
返回是否应该懒加载此bean,即不是在启动时立马执行实例化。仅适用于单例bean
*/
boolean isLazyInit(); /**
* Set the names of the beans that this bean depends on being initialized.
* The bean factory will guarantee that these beans get initialized first.
设置此bean依赖于初始化的bean的名称
bean工厂将保证首先初始化这些bean
*/
void setDependsOn(String... dependsOn); /**
* Return the bean names that this bean depends on.
返回此bean所依赖的bean名称
*/
String[] getDependsOn(); /**
* Set whether this bean is a candidate for getting autowired into some other bean.
* <p>Note that this flag is designed to only affect type-based autowiring.
* It does not affect explicit references by name, which will get resolved even
* if the specified bean is not marked as an autowire candidate. As a consequence,
* autowiring by name will nevertheless inject a bean if the name matches.
设置此bean是否可以自动连接到其它bean
请注意,此标志仅用于影响基于类型的自动装配
它不会影响名称的显式引用,甚至可以解析
如果指定的bean未标记为autowire候选者,作为结果
如果名称匹配,按名称自动装配将注入一个bean
*/
void setAutowireCandidate(boolean autowireCandidate); /**
* Return whether this bean is a candidate for getting autowired into some other bean.
返回此bean是否可以自动连接到其它Bean中
*/
boolean isAutowireCandidate(); /**
* Set whether this bean is a primary autowire candidate.
* <p>If this value is {@code true} for exactly one bean among multiple
* matching candidates, it will serve as a tie-breaker.
设置此bean是否为主要的autowire候选者
*/
void setPrimary(boolean primary); /**
* Return whether this bean is a primary autowire candidate.
返回此bean是否是主要的autowire候选者
*/
boolean isPrimary(); /**
* Specify the factory bean to use, if any.
* This the name of the bean to call the specified factory method on.
* @see #setFactoryMethodName
指定要使用的工厂bean,这是调用指定工厂方法的bean的名称
*/
void setFactoryBeanName(String factoryBeanName); /**
* Return the factory bean name, if any.
如果有的话,返回bean工厂的名称
*/
String getFactoryBeanName(); /**
* Specify a factory method, if any. This method will be invoked with
* constructor arguments, or with no arguments if none are specified.
* The method will be invoked on the specified factory bean, if any,
* or otherwise as a static method on the local bean class.
如果有的话,设置指定工厂方法,将使用此方法调用此方法构造函数参数,如果没有指定,
则不带参数。将在指定的工厂bean上调用该方法。如果有的话,或者作为本地bean类的
静态方法
*/
void setFactoryMethodName(String factoryMethodName); /**
* Return a factory method, if any.
如果有的话,返回工厂方法
*/
String getFactoryMethodName(); /**
* Return the constructor argument values for this bean.
* <p>The returned instance can be modified during bean factory post-processing.
* @return the ConstructorArgumentValues object (never {@code null})
返回此bean的构造函数参数值,可以在Bean工厂后期处理修改返回的实例
*/
ConstructorArgumentValues getConstructorArgumentValues(); /**
* Return the property values to be applied to a new instance of the bean.
* <p>The returned instance can be modified during bean factory post-processing.
* @return the MutablePropertyValues object (never {@code null})
返回要应用于bean的新势力的属性值
*/
MutablePropertyValues getPropertyValues(); // Read-only attributes /**
* Return whether this a <b>Singleton</b>, with a single, shared instance
* returned on all calls.
返回是否为单例模式*/
boolean isSingleton(); /**
* Return whether this a <b>Prototype</b>, with an independent instance
* returned for each call.
返回是否为Prototype(原型模式)*/
boolean isPrototype(); /**
* Return whether this bean is "abstract", that is, not meant to be instantiated.
返回此Bean是否为抽象bean,即不是要实例化
*/
boolean isAbstract(); /**
* Get the role hint for this {@code BeanDefinition}. The role hint
* provides the frameworks as well as tools with an indication of
* the role and importance of a particular {@code BeanDefinition}.
获取此BeanDefinition的角色提示,角色提示提供框架以及指示的工具*/
int getRole(); /**
* Return a human-readable description of this bean definition.
返回此bean定义的可读描述
*/
String getDescription(); /**
* Return a description of the resource that this bean definition
* came from (for the purpose of showing context in case of errors).
返回此bean定义的资源的描述
来自(为了在出现错误时显示上下文)
*/
String getResourceDescription(); /**
* Return the originating BeanDefinition, or {@code null} if none.
* Allows for retrieving the decorated bean definition, if any.
* <p>Note that this method returns the immediate originator. Iterate through the
* originator chain to find the original BeanDefinition as defined by the user.
返回原始BeanDefinition,如果没有,则返回Null
*/
BeanDefinition getOriginatingBeanDefinition(); }
spring源码 继承AttributeAccessor的BeanDefinition接口的更多相关文章
- Spring源码分析——BeanFactory体系之接口详细分析
Spring的BeanFactory的继承体系堪称经典.这是众所周知的!作为Java程序员,不能错过! 前面的博文分析了Spring的Resource资源类Resouce.今天开始分析Spring的I ...
- spring源码 RootBeanDefinition类的根接口AttributeAccessor
/** * Interface defining a generic contract for attaching and accessing metadata * to/from arbitrary ...
- 读spring源码(二)-XmlBeanDefinitionReader-解析BeanDefinition
上次说到ApplicationContext加载BeanDefinition时会创建一个XmlBeanDefinitionReader,将XML解析.BeanDefinition加载委托给XmlBea ...
- Spring源码窥探之:xxxAware接口
Aware接口是一个标志性接口,继承此接口的接口xxxAware的实现类,在容器创建完成后,会回调实现方法,下面举例: 1. 有很多xxxAware接口,下面举两个例子 /** * descripti ...
- Spring源码分析——BeanFactory体系之抽象类、类分析(二)
上一篇分析了BeanFactory体系的2个类,SimpleAliasRegistry和DefaultSingletonBeanRegistry——Spring源码分析——BeanFactory体系之 ...
- Spring源码学习之BeanFactory体系结构
一.BeanFactory BeanFactory是Spring IOC容器的鼻祖,是IOC容器的基础接口,所有的容器都是从它这里继承实现而来.可见其地位.BeanFactory提供了最基本的IOC容 ...
- CRUD搬砖两三年了,怎么阅读Spring源码?
作者:小傅哥 博客:https://bugstack.cn 沉淀.分享.成长,让自己和他人都能有所收获! 连读同事写的代码都费劲,还读Spring? 咋的,Spring 很难读! 这个与我们码农朝夕 ...
- Spring源码分析——BeanFactory体系之抽象类、类分析(一)
上一篇介绍了BeanFactory体系的所有接口——Spring源码分析——BeanFactory体系之接口详细分析,本篇就接着介绍BeanFactory体系的抽象类和接口. 一.BeanFactor ...
- Spring源码解析(一)开篇
前言 Spring源码继承结构比较复杂,看过以后经常会忘记.因此,记录一下源码分析的过程,方便以后回顾.本次分析的Spring源码版本为3.2.15. 另外,一提Spring就是IOC.DI等等,我们 ...
随机推荐
- Rabbitmq概念用法
MQ全称为Message Queue, 是一种分布式应用程序的的通信方法,它是消费-生产者模型的一个典型的代表,producer往消息队列中不断写入消息,而另一端consumer则可以读取或者订阅队列 ...
- 如何使用Python输出一个[斐波那契数列]
如何使用Python输出一个[斐波那契数列]Fibonacci 斐波那契数列(Fibonacci sequence),又称黄金分割数列.因数学家列昂纳多·斐波那契(Leonardoda Fibonac ...
- 新闻网大数据实时分析可视化系统项目——12、Hive与HBase集成进行数据分析
(一)Hive 概述 (二)Hive在Hadoop生态圈中的位置 (三)Hive 架构设计 (四)Hive 的优点及应用场景 (五)Hive 的下载和安装部署 1.Hive 下载 Apache版本的H ...
- Keepalived——HA
一.HA集群中的相关术语 1.节点(node) 运行HA进程的一个独立主机,称为节点,节点是HA的核心组成部分,每个节点上运行着操作系统和高可用软件服务,在高可用集群中,节点有主次之分,分别称之为主节 ...
- mysql安装到最后一步无响应的问题超简单最有效解决
mysql安装到最后一步无响应的问题超简单最有效解决 无论你是安装过还是没安装过,通过此方法都可以解决.之前我的机器和服务器就是都到最后一步卡住,上网搜索方法都无果.后自己尝试了很多次,亲测64位机和 ...
- Day12:看节目对于高考的想法
今天看了一个科教频道的说高考的节目~ 老师问孩子的为什么要高考~ 学生说:为了以后不用辛苦,不用像爸妈一样再大冬天奔波,不辜负爸妈的期望~ 学习!高考!科举制度害了多少读书人?! 现在的高考跟科举有区 ...
- redis.rpm 安装
yum install jemalloc wget http://www6.atomicorp.com/channels/atomic/centos/6/x86_64/RPMS/redis-3.0.7 ...
- 《ES6标准入门》(阮一峰)--12.Symbol
1.概述 ES5 的对象属性名都是字符串,这容易造成属性名的冲突.比如,你使用了一个他人提供的对象,但又想为这个对象添加新的方法(mixin 模式),新方法的名字就有可能与现有方法产生冲突.如果有一种 ...
- Day4 - G - 确定比赛名次 HDU - 1285
有N个比赛队(1<=N<=500),编号依次为1,2,3,....,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个队的比赛成绩,只知道 ...
- C++ 语言程序设计(清华大学)2
面向对象 1.面向对象程序基本特点:抽象.封装.继承.多态 2.类分为:公有类型成员public(接口),私有类型成员private(本类函数访问,类外要用友元函数访问),保护类型成员protect( ...