N
Size: a a a
N
AF
ES
ES
public interface FooInterface {
void foo();
}@Bean
public FooInterface fooInterface() {
return (FooInterface) Proxy.newProxyInstance(
SpringBootApplication.class.getClassLoader(),
new Class[]{FooInterface.class},
(proxy, method, args) -> {
log.info("Invoke method: {}", method.getName());
return null;
}
);
}N
ES
N
AE
N
AE
AE
КВ
NG
А
CompletableFuture
.runAsync(() -> {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
})
.thenAccept(x -> {
System.out.println("Good");
})
.orTimeout(2, TimeUnit.SECONDS)
.thenAccept(x-> {
System.out.println("if timeout logic");
});V