![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
springBoot
stone-no1
这个作者很懒,什么都没留下…
展开
-
springBoot中CommandLineRunner与ApplicationRunner接口
springBoot提供这两个接口的问题是在容器加载完成之后执行一些动作如:处理某些特殊业务等。不同之处在于:ApplicationRunner中run方法的参数为ApplicationArguments,而CommandLineRunner接口中run方法的参数为String数组。当接口有多个实现类时,提供了@Order(value=整数值)注解实现从小到大依次自定义顺序执行,也可以实现...原创 2019-01-04 16:49:58 · 181 阅读 · 0 评论 -
springBoot中@Scheduled创建定时任务
1.在Spring Boot的主类中加入@EnableScheduling注解,启用定时任务的配置@SpringBootApplication@EnableSchedulingpublic class Application { public static void main(String[] args) { SpringApplication.run(Application.c...原创 2019-01-07 17:28:15 · 76 阅读 · 0 评论 -
sprinBoot中@Async异步方法
在Spring中,基于@Async标注的方法,称之为异步方法;这些方法将在执行的时候,将会在独立的线程中被执行,调用者无需等待它的完成,即可继续其他的操作。1.自定义线程池异步调用配置@EnableAsync使@Async生效@SpringBootApplication@EnableAsyncpublic class Application { public static ...原创 2019-01-07 20:22:57 · 1588 阅读 · 0 评论 -
springBoot日志处理
默认配置application.properties中设置spring.output.ansi.enabled参数来支持多才输出。 NEVER:禁用ANSI-colored输出(默认项) DETECT:会检查终端是否支持ANSI,是的话就采用彩色输出(推荐项) ALWAYS:总是使用ANSI-colored格式输出,若终端不支持的时候,会有很多干扰信息...原创 2019-01-07 21:20:48 · 682 阅读 · 0 评论