
Spring开发
文章平均质量分 66
spring,springboot原理和实战
优惠券已抵扣
余额抵扣
还需支付
¥9.90
¥99.00
购买须知?
本专栏为图文内容,最终完结不会低于15篇文章。
订阅专栏,享有专栏所有文章阅读权限。
本专栏为虚拟商品,基于网络商品和虚拟商品的性质和特征,专栏一经购买无正当理由不予退款,不支持升级,敬请谅解。
后台开发者Ethan
李大健一个想从事大数据的java开发者、go初级学习者
展开
-
AbstractAutoProxyCreator
不同于ProxyFactory和ProxyFactoryBean 给单个bean增加代理。spring提供了基于一定规则自动发现和代理。public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport implements SmartInstantiationAwareBeanPostProcessor, BeanFactoryAware {ProxyProcessorSupport 继承自Pro.原创 2021-10-26 14:20:31 · 266 阅读 · 0 评论 -
spring-advisor-advised
Advisor接口,holding advice(action to take at a joinpoint,在连接点上执行的动作)和pointcut。Advice EMPTY_ADVICE = new Advice() {};Advice getAdvice(); 返回aspect切面的advice部分,advice可以是Interceptor,before advice或者throws advice等,如果pointcut匹配到的话 就返回对应的advice。Default...原创 2021-10-20 15:29:24 · 176 阅读 · 0 评论 -
aopalliance-invocation-methodInterceptor-advice
org.aopalliance.intercept.Joinpoint 顶层接口表示一个运行时的连接点,For instance, an* invocation is the runtime joinpoint on a method (static joinpoint)proceed() :Proceed to the next interceptor in the chainorg.aopalliance.intercept.Invocation一个invocat...原创 2021-10-20 11:44:31 · 156 阅读 · 0 评论 -
JdkDynamicAopProxy 和 CglibAopProxy
JdkDynamicAopProxy 属性AdvisedSupport ,它是aop 代理的配置。当我们创建代理的时候会将config传递进去。JdkDynamicAopProxy 获取代理:生成jdk原生动态代理对象,同时将自己传递进去,实现了InvocationHandler的接口,@Override public Object getProxy(@Nullable ClassLoader classLoader) { if (logger.isDebugEnabled()) {...原创 2021-10-19 18:49:33 · 181 阅读 · 0 评论 -
ProxyFactory
@Test public void test(){ ProxyFactory proxyFactory = new ProxyFactory(); // 可改变target的引用 HotSwappableTargetSource targetSource = new HotSwappableTargetSource(new DemoOne("黄晓明")); proxyFactory.setTargetSource(...原创 2021-10-19 18:27:08 · 496 阅读 · 0 评论 -
spring bean生命周期和循环引用
spring 对单例的简单bean(未被代理)解决了循环引用的问题,且spring是通过set方式才能实现,构造器注入是不行的关于多级缓存的问题:https://cloud.tencent.com/developer/article/1497692首先创建原始的bean添加到缓存(此时一级缓存坑定是没有的)添加入到三级缓存,这是一个factorygetEarlyBeanReference SmartInstantiationAwareBeanPostProce...原创 2021-10-12 09:43:00 · 130 阅读 · 0 评论 -
spring redis缓存原理
spring cache启动开关 EnabelCaching @EnableAsync@SpringBootApplication(scanBasePackages={"com.lls.asset.service"},exclude={DataSourceAutoConfiguration.class,MybatisPlusConfig.class})@NacosPropertySources({@NacosPropertySource(dataId=...原创 2021-10-09 14:04:25 · 138 阅读 · 0 评论 -
ApplicationEvent原理
org.springframework.context.support.AbstractApplicationContext#publishEvent(org.springframework.context.ApplicationEvent)/** * Publish the given event to all listeners. * @param event the event to publish (may be an {@link ApplicationEvent} * or a原创 2021-09-27 13:22:19 · 366 阅读 · 0 评论 -
泛型-type
能够取到的一定是确定好的,字节码里面存在的一些泛型参数类型原创 2021-09-23 21:50:49 · 108 阅读 · 0 评论 -
spring 挂扣
SmartInitializingSingleton:调用链路: 在所有bean完成初始化之后回调 bean需要实现此接口org.springframework.context.support.AbstractApplicationContext#refresh-// Instantiate all remaining (non-lazy-init) singletons. finishBeanFactoryInitialization(beanFactory); -// Inst..原创 2021-09-14 14:54:23 · 90 阅读 · 0 评论 -
FactoryBean
先工厂bean &beanName 后再次 getBean(beanName):原创 2021-09-14 12:49:09 · 75 阅读 · 0 评论 -
@Aspectj 自动代理原理
@EnableAspectJAutoProxyorg.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator extends AspectJAwareAdvisorAutoProxyCreator extendsAbstractAdvisorAutoProxyCreator extendsAbstr...原创 2021-08-10 17:48:41 · 229 阅读 · 0 评论 -
Spring AOP APIs-Part III. Core Technologies翻译
12.Spring AOP APIs12.1 介绍12.2 spring中的Pointcut12.2.1 概念spring的pointcut模式可以使得pointcut重复使用advice类型,它可以使用相同的poincut定位到不同的advice上。org.springframework.aop.Pointcut接口是个核心的接口,用于将advices定位到特定的类和方法上。完整接口如下:public interface Pointcut { ClassF...原创 2021-08-10 16:37:18 · 119 阅读 · 0 评论 -
Spring防坑指南
beanName:默认生成策略通常我们默认注解生成的spring bean 的名称是由org.springframework.context.annotation.AnnotationBeanNameGenerator生成的public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) { if (definition instanceof AnnotatedBeanD..原创 2021-07-08 23:02:13 · 94 阅读 · 0 评论 -
MethodInterceptor、Advice、Advisor
一个简单的例子:public class DemoMain { public static void main(String[] args) throws Exception { Student student = new Student(); AspectJProxyFactory aspectJProxyFactory = new AspectJProxyFactory(student); aspectJProxyFactory.addA原创 2021-06-29 20:24:15 · 302 阅读 · 0 评论 -
ReflectiveMethodInvocation
JointPoint 表示一个正在运行时的一个joinpoint,比如方法的一次执行MethodInvocation 描述的是an invocation to a method。他也是一个joinpoint,可以被method interceptor 拦截。ReflectiveMethodInvocation 也是表示方法的执行,通过反射的方式调动目标方法。通过反射的方式执行joinpoint即目标的方法(spring只支持方法)protected Object invokeJo...原创 2021-06-28 20:18:57 · 1293 阅读 · 0 评论 -
Cglib代理底层原理
Demo:public static void main(String[] args) throws Exception { System.setProperty(DebuggingClassWriter.DEBUG_LOCATION_PROPERTY, "D:\\tmp"); Enhancer enhancer = new Enhancer(); enhancer.setSuperclass(Student.class); enhanc原创 2021-06-21 15:10:13 · 165 阅读 · 0 评论 -
SpringAOP api设计和实现
接入点接口-JoinPointInterceptor执行上下文-Invocation方法拦截器上下文-MethodInvocation 构造器拦截器山下文-ConstructorInvocation 仅spring支持方法界别MethodInvocation实现基于反射-ReflectiveMethodInvocation 基于CGLIB-CglibMethodInvcationorg.aopalliance.intercept.Joinpoint 该接口...原创 2021-06-19 14:38:35 · 120 阅读 · 0 评论 -
转换DefaultConversionService
static DefaultConversionService defaultConversionService = new DefaultConversionService();Boolean convert = defaultConversionService.convert(bool, Boolean.class);@desc* trueValues.add("true");* trueValues.ad d("on");* trueValues.ad..原创 2021-05-26 20:11:37 · 579 阅读 · 0 评论 -
@value 的属性自动注入以及static,final修饰如何处理
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#populateBean 里面的方法就是处理@Autowire 和 @Value的boolean hasInstAwareBpps = hasInstantiationAwareBeanPostProcessors(); boolean needsDepCheck = (mbd.getDependencyCheck() != RootBeanD.原创 2021-04-21 14:33:28 · 3387 阅读 · 0 评论