bean生命周期相关
- 适合观察
bean定义注册到容器的断点位置
public void registerBeanDefinition(String beanName, BeanDefinition beanDefinition) {
}
- 适合观察从容器获取
bean实例的断点位置
protected <T> T doGetBean(final String name, @Nullable final Class<T> requiredType,
@Nullable final Object[] args, boolean typeCheckOnly) throws BeansException {
}
- 适合观察容器创建
bean实例的断点位置
package org.springframework.beans.factory.support;
protected Object createBean(String beanName, RootBeanDefinition mbd, @Nullable Object[] args)
throws BeanCreationException {
}
配置类处理相关
- 适合观察一组配置类中的
bean定义被注册到容器的断点位置
public void loadBeanDefinitions(Set<ConfigurationClass> configurationModel){
}
Spring Web MVC
- 观察
DispatcherServlet处理某个请求最终采用的HandlerMapping组件
protected HandlerExecutionChain getHandler(HttpServletRequest request) throws Exception {
if (this.handlerMappings != null) {
for (HandlerMapping mapping : this.handlerMappings) {
HandlerExecutionChain handler = mapping.getHandler(request);
if (handler != null) {
return handler;
}
}
}
return null;
}