Comments (13)
这破玩意儿这么复杂的吗
一开始是以xml为入口看的,之后就是以web为入口看的(想看controller的实例化过程),所以笔记有点混乱
from blog.
②--常用接口
记录一些常用到的接口的功能
- BeanPostProcessor : 用来做一些bean的初始化/销毁时调用的函数(hook)
- PriorityOrdered :
下面这两个接口影响到添加BeanPostProcessor 的标志位 - InstantiationAwareBeanPostProcessor : 可在bean实例化前/后调用的方法
- DestructionAwareBeanPostProcessor:可在bean销毁前调用方法
以上所述方法都是接口中的方法
😂
- SingletonBeanRegistry:公用的单实例注册接口
- ThemeSource : 用来管理Theme
- Theme : 用来管理MessageSource
- ApplicationEventMulticaster : 用来管理ApplicationListener和他的事件
- Aware :
+Environment :代表了当前程序运行的环境。同时创建代表环境的两个重要的概念,profiles和properties。profiles也就是一些bean(从xml或者注解而来)。
from blog.
③可以研究的细节(未分类的意思)
-
getBeanNamesForType 的具体实现方式(先看作一个整体,方便阅读源码逻辑)
-
RootBeanDefinition 这个类在bean创建的时候被用到
from blog.
④--RequestDispatcherServlet
前瞻
spring同一般的tomcat的servlet程序,只在web.xml处多配了 ContextLoaderListener和RequestDispatcherServlet两个类,就完成了servlet的拓展。看过了ComtextLoaderListener后(一知半解),再来看看ResquestDispatcherServlet。
在web.xml把他配成了一个servlet,并映射到 “/”路径上(一般情况下),这样任何请求都会到这个servlet里面。
观察其重写方法( init() , service(req,resp) , destroy() )的位置,
- 重写 init()方法在 HttpServletBean 里面,
- 重写 service() 方法在 FrameworkServlet 里面(同时也重写了do**方法)
- 重写 destory() 方法在 FrameworkServlet 里面
流程简介
这个流程把主要的方法(有注释的方法
from blog.
⑤--注解记录--持续更新
bean factory 的初始化
-
*
- BeanNameAware's {@code setBeanName} *
- BeanClassLoaderAware's {@code setBeanClassLoader} *
- BeanFactoryAware's {@code setBeanFactory} *
- EnvironmentAware's {@code setEnvironment} *
- EmbeddedValueResolverAware's {@code setEmbeddedValueResolver} *
- ResourceLoaderAware's {@code setResourceLoader} * (only applicable when running in an application context) *
- ApplicationEventPublisherAware's {@code setApplicationEventPublisher} * (only applicable when running in an application context) *
- MessageSourceAware's {@code setMessageSource} * (only applicable when running in an application context) *
- ApplicationContextAware's {@code setApplicationContext} * (only applicable when running in an application context) *
- ServletContextAware's {@code setServletContext} * (only applicable when running in a web application context) *
- {@code postProcessBeforeInitialization} methods of BeanPostProcessors *
- InitializingBean's {@code afterPropertiesSet} *
- a custom init-method definition *
- {@code postProcessAfterInitialization} methods of BeanPostProcessors *
from blog.
spring-Integration(好用的很)
Remoting
JMS
JCA
JCA
Tasks
Scheduling
介绍一下Cron表达式
Cron表达式由6或7个空格分割的时间字段组成,各个字段的含义:
字段位置 | 位置含义 | 允许值 | 允许的特殊字符 |
---|---|---|---|
1 | 秒 | 0-59 | , - * / |
2 | 分钟 | 0-59 | , - * / |
3 | 小时 | 0-23 | , - * / |
4 | 日期 | 1-31 | , - * ? / L W C |
5 | 月份 | 1-12 | , - * / |
6 | 星期 | 1-7 | , - * ? / L C # |
7 | 年(可选) | 空值;1970-2099 | , - * / |
特殊字符含义:
- 星号(*):表示对应时间域的每一时刻
- 问好(?):只能在日期和星期字段中使用,为“无意义的值”
- 减号(-):表达一个范围
- 逗号(,):表达一个列表值
- 斜杠(/):(x/y)表达一个等步长序列,x为起始值,y为增量步长值
- L:只能在日期和星期字段中使用,代表LAST。日期中表示月份的最后一天;星期中表示星期六;但出现在星期中。且前面有数字X时,表示这个月的最后X天,例如5L,该月最后星期四。
- W:只能出现在日期字段里,表示距离该星期最近的工作日。
- LW:当月最后一个工作日
9.井号(#):只能在星期字段中使用,表示当月的某个工作日。 6#3表示该月第三个星期五。没有则忽略不触发 - C:日期和星期中使用。表示计划所关联的日期。5C(不是很懂)
要配合springboot用的话
@Configuration
@EnableAsync
@EnableScheduling
public class AnsyConfig {
@Scheduled(cron = "0/15 * * * * *")
public void method1(){ System.out.println(1000); }
}
Cache
SPEL
from blog.
占楼
from blog.
占楼
from blog.
占楼
from blog.
占楼
from blog.
占楼
from blog.
占楼
from blog.
占楼
from blog.
Related Issues (20)
- spring源码阅读笔记④--RequestDispatcherServlet
- springboot笔记 HOT 6
- springcloud文档阅读笔记
- spring data JPA 笔记 HOT 3
- Blog 项目所遇到部分问题 HOT 1
- MYSQL笔记 HOT 2
- Intellij Idea相关笔记 HOT 3
- Javascript/TypeScript/thymeleaf.....
- Java-other HOT 2
- Tool Mark HOT 2
- spring源码阅读笔记②--常用接口
- Golang HOT 3
- spring源码阅读笔记③
- spring源码阅读笔记⑤--注解记录--持续更新
- maven笔记 HOT 1
- springboot配置服务器符合CORS规范
- 《鸟叔的Linux私房菜》读书笔记 HOT 1
- Spring Security 文档阅读笔记 HOT 1
- code-base HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blog.