8 -- 深入使用Spring -- 2...5 Spring 3.0 新增的注解
8.2.5 Spring 3.0 新增的注解
@DependsOn @Lazy
@DependsOn :用于强制初始化其他Bean。修饰Bean类或方法,可以指定一个字符串数组作为参数,每个数组元素对应一个强制初始化的Bean。
package edu.pri.lime._8_2_5.bean; import org.springframework.context.annotation.DependsOn;
import org.springframework.stereotype.Component; @DependsOn({"steelAxe","lime"}) //指定在初始化chinese Bean之前,会强制初始化steelAxe、lime两个Bean
@Component
public class Chinese { }
@Lazy : 用于指定该Bean是否取消预初始化。
package edu.pri.lime._8_2_5.bean; import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component; @Lazy(true) //修饰Spring Bean 类用于指定该Ben的预初始化行为,指定一个boolean型的value属性,该属性决定是否要预初始化该Bean
@Component
public class French { }
啦啦啦
8 -- 深入使用Spring -- 2...5 Spring 3.0 新增的注解的更多相关文章
- 【Spring】浅析Spring框架的搭建
c目录结构: // contents structure [-] Spring是什么 搭建Spring框架 简单Demo 1,建立User类 2,建立Test类 3,建立ApplicationCont ...
- Spring系列之Spring常用注解总结
传统的Spring做法是使用.xml文件来对bean进行注入或者是配置aop.事物,这么做有两个缺点:1.如果所有的内容都配置在.xml文件中,那么.xml文件将会十分庞大:如果按需求分开.xml文件 ...
- Spring集成jedis支持Redis3.0集群
接着上一节,我们通过spring FactoryBean实现redis 3.0集群JedisCluster与spring集成. http://www.linuxidc.com/Linux/2016- ...
- spring笔记3 spring MVC的基础知识3
4,spring MVC的视图 Controller得到模型数据之后,通过视图解析器生成视图,渲染发送给用户,用户就看到了结果. 视图:view接口,来个源码查看:它由视图解析器实例化,是无状态的,所 ...
- spring笔记1 spring MVC的基础知识1
1,spring MVC的流程 优秀的展现层框架-Spring MVC,它最出彩的地方是注解驱动和支持REST风格的url. 流程编号 完成的主要任务 补充 1 用户访问web页面,发送一个htt ...
- spring 缓存(spring自带Cache)(入门)
spring的缓存机制,是方法纬度的缓存机制, 这就意味着我们并不用关注 底层是否使用了数据库以及通过什么方式访问的数据库: 因此,此缓存方法既适用于dao层,也适用于service层. spring ...
- Springmvc + mybatis + spring 配置,spring事物
今天配置了半天,发现,事物不起效果,主要出现如下错误: org.mybatis.spring.transaction.SpringManagedTransaction] - [JDBC Connect ...
- Spring学习笔记—Spring之旅
1.Spring简介 Spring是一个开源框架,最早由Rod Johnson创建,并在<Expert One-on-One:J2EE Design and Development> ...
- 【Spring】初始化Spring IoC容器(非Web应用),并获取Bean
参考文章 Introduction to the Spring IoC container and beans BeanFactory 和ApplicationContext(Bean工厂和应用上下文 ...
随机推荐
- 微信小程序——template的使用方法
今天需要做一个[我的订单]页面,订单有几种状态,觉得把订单列表封装成一个模板更好.下面讲一下,如何用小程序自带的template构建一个模板. 1.构建订单列表模板页,命名为 [order.wxml] ...
- SimpleDraweeView 设置圆角不生效问题
采用的是xml配置 roundedCornerRadius 参数方法 adverPic.setImageURI("http://xx.xx.xx.xx/123.jpg"); 设置c ...
- 【转】C#多线程环境下调用 HttpWebRequest 并发连接限制
.net 的 HttpWebRequest 或者 WebClient 在多线程情况下存在并发连接限制,这个限制在桌面操作系统如 windows xp , windows 7 下默认是2,在服务器操作 ...
- Android wpa_supplicant 启动过程
记录wpa_supplicant启动过程 ini脚本: service wpa_supplicant /vendor/bin/hw/wpa_supplicant \ -ip2p0 -Dnl80211 ...
- Mybatis系列(二):优化MyBatis配置文件中的配置和解决字段名与实体类属性名不相同的冲突
原文链接:http://www.cnblogs.com/xdp-gacl/p/4264301.html http://www.cnblogs.com/xdp-gacl/p/4264425.ht ...
- e611. Setting Focus Traversal Keys for the Entire Application
This example changes the focus traversal keys for the entire application. For an example of how to c ...
- php 一维数组去重
$input = array("a" => "green", "red", "b" => "gre ...
- 图像处理、计算机视觉与模式识别“SCI期刊和顶级会议”总结
期刊: best (1) IEEE Transactions on Pattern Analysis and Machine Intelligence,IEEE模式分析与机器智能汇刊,简称PAMI,是 ...
- 10.6 监控io性能 10.7 free命令 10.8 ps命令 10.9 查看网络状态 10.10 linux下抓包
iostat sysstat 包里面包括 sar 和 iostat [root@centos7 ~]# iostat Linux 3.10.0-693.2.2.el7.x86_64 (centos7. ...
- Mac/win eclipse genymotion 插件下载地址
eclipse -->new install --> 填写该地址 (目前最新的地址) https://dl.genymotion.com/eclipse/