上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 81 下一页
摘要: 一、 InitialingBean接口(bean属性设置完成后添加操作) 实现afterPropertiesSet()方法 二、 DisposableBean接口(bean实例销毁之前时做一些收尾工作) 实现destory()方法 三、 BeanNameAware接口(bean加载的过程中获取到be 阅读全文
posted @ 2020-01-10 22:18 ppjj 阅读(583) 评论(0) 推荐(0) 编辑
摘要: Spring Boot and Exit Codes Spring向JVM注册关闭钩子,以确保ApplicationContext在退出时正常关闭。除此之外,Spring还提供了ExitCodeGenerator接口。调用System.exit()时,此接口可以返回特定代码。 实现 Exit Cod 阅读全文
posted @ 2020-01-10 22:17 ppjj 阅读(670) 评论(0) 推荐(0) 编辑
摘要: 分析过程: 开启异步代理 初始化excutor和exceptionHandler 定义切面处理 线程处理 @EnableAsync @EnableAsync是开启某个模块的功能加载,之前在《导图梳理springboot手动、自动装配,让springboot不再难懂》介绍过,@EnableXXX一般都 阅读全文
posted @ 2020-01-10 22:15 ppjj 阅读(5589) 评论(0) 推荐(0) 编辑
摘要: 缓存是我们常用的一种优化系统的方案。 无论是前端缓存还是应用层缓存或者数据库缓存,其本质都是将查询过的数据缓存下来,下次再次查询该数据的时候如果数据没有过期,则直接返回缓存中该数据即可,不再执行查询操作。 SpringCache是我们常用的一种应用层缓存方案,其一般应用在方法上,下面我们先来看下具体 阅读全文
posted @ 2020-01-10 22:12 ppjj 阅读(1207) 评论(0) 推荐(0) 编辑
摘要: 1.Spring容器会自动把上下文环境对象调用ApplicationContextAware接口中的setApplicationContext方法;当一个类实现了这个接口之后,这个类就可以非常方便的获取到ApplicationContext中的所有的bean;简而言之,言而总之,此类可以获取到spr 阅读全文
posted @ 2020-01-10 21:52 ppjj 阅读(2306) 评论(0) 推荐(0) 编辑
摘要: public class Other implements IntroductionInterceptor,IOther{ public void doOther(){ System.out.println("Other对象的功能"); } public Object invoke(MethodInvocation methodInvocation) throws Throwable { if(i 阅读全文
posted @ 2020-01-10 21:45 ppjj 阅读(523) 评论(0) 推荐(0) 编辑
摘要: 本文介绍在Web服务器做出响应时,为了提高安全性而在HTTP响应头中可以使用的各种响应头字段。由于部分浏览器中有可能对某些字段或选项不提供支持,所以在使用这些字段时请先确认客户端环境。 X-Frame-Options 该响应头中用于控制是否在浏览器中显示frame或iframe中指定的页面,主要用来 阅读全文
posted @ 2020-01-10 21:42 ppjj 阅读(647) 评论(0) 推荐(0) 编辑
摘要: TargetSource(目标源)是被代理的target(目标对象)实例的来源。TargetSource被用于获取当前MethodInvocation(方法调用)所需要的target(目标对象),这个target通过反射的方式被调用(如:method.invode(target,args))。换句话 阅读全文
posted @ 2020-01-10 21:37 ppjj 阅读(3198) 评论(0) 推荐(0) 编辑
摘要: The reason is that the XML framework tries to instantiate classes using reflection and does this from the thread context classloader (PowerMock's clas 阅读全文
posted @ 2020-01-09 23:28 ppjj 阅读(2529) 评论(0) 推荐(0) 编辑
摘要: application.properties中增加 context.listener.classes=demo.springboot.listener.ApplicationEventListener 实现接口ApplicationListener package demo.springboot.l 阅读全文
posted @ 2020-01-09 23:24 ppjj 阅读(5138) 评论(0) 推荐(0) 编辑
上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 81 下一页