摘要: 一、自定义注解 @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface CopyAsync { } 二、编写AOP切面类 @Aspect @Component public class Cop 阅读全文
posted @ 2022-06-21 22:25 DiligentCoder 阅读(73) 评论(0) 推荐(0) 编辑
摘要: 前言 从Java 5开始,Java提供了Callable接口,该接口是Runnable接口的增强版,Callable接口提供了一个call()方法,可以看作是线程的执行体,但call()方法比run()方法更强大, call()方法可以有返回值,call()方法可以声明抛出异常。 使用代码 publ 阅读全文
posted @ 2022-06-21 21:51 DiligentCoder 阅读(250) 评论(0) 推荐(0) 编辑