随笔分类 -  Java

Java学习篇
摘要:JVM致命错误日志(hs_err_pid.log)分析 当jvm出现致命错误时,会生成一个错误文件 hs_err_pid<pid>.log,其中包括了导致jvm crash的重要信息,可以通过分析该文件定位到导致crash的根源,从而改善以保证系统稳定。当出现crash时,该文件默认会生成到工作目录 阅读全文
posted @ 2021-10-29 09:40 Hlooc 阅读(7308) 评论(0) 推荐(0)
摘要:SpringBoot仿Zuul报文转发 基于RestTemplate从request中提取出header、body等内容,构造一个RequestEntity,后续可以用RestTemplate来发送请求 请求入口RestController public final static String DE 阅读全文
posted @ 2021-07-31 18:08 Hlooc 阅读(569) 评论(0) 推荐(0)
摘要:import cn.hutool.core.date.DateUtil; import junit.framework.TestCase; import java.util.concurrent.*; public class TestJug extends TestCase { public vo 阅读全文
posted @ 2021-07-21 16:19 Hlooc 阅读(166) 评论(0) 推荐(0)
摘要:andThen先执行自己再执行入参函数,compose反之 Function<Integer, Integer> f1 = n -> n * n; Function<Integer, Integer> f2 = n -> n * n * 3; System.out.println(f1.andThe 阅读全文
posted @ 2021-01-19 10:48 Hlooc 阅读(187) 评论(0) 推荐(0)
摘要:Runnable实现龟兔赛跑 public class RaceTest implements Runnable { private static String winner = null; @Override public void run() { for (int i = 1; i <= 101 阅读全文
posted @ 2021-01-16 15:18 Hlooc 阅读(93) 评论(0) 推荐(0)
摘要:Callable实现龟兔赛跑 线程池使用的Executors.newFixedThreadPool(2) package cn.hlooc; import java.util.ArrayList; import java.util.List; import java.util.concurrent. 阅读全文
posted @ 2021-01-02 22:52 Hlooc 阅读(242) 评论(0) 推荐(0)
摘要:多线程信号的玩法 public class SignTest { public static void main(String[] args) { Drama drama = new Drama(); new Thread(new Actor(drama)).start(); new Thread( 阅读全文
posted @ 2021-01-02 12:35 Hlooc 阅读(122) 评论(0) 推荐(0)
摘要:Cabllable实现龟兔赛跑 package cn.hlooc; import java.util.ArrayList; import java.util.List; import java.util.concurrent.*; public class RaceTest implements C 阅读全文
posted @ 2021-01-01 17:25 Hlooc 阅读(89) 评论(0) 推荐(0)