Java Exchanger 基本用法 demo 2017年9月17日 | Leave a comment 问题: 解决: //ExchangerTest.java //javac ExchangerTest.java && java ExchangerTest import java.util.concurrent.*; class ExchangerTest{ public static void main(String[] argv){ Exchanger<String> ex = new Exchanger<>(); Thread t1 = new Thread(()->{ try{ String msg = ex.exchange("T1 welcome"); System.out.println("t1 get msg : "+msg); }catch(Exception e){} }); t1.start(); Thread t2 = new Thread(()->{ try{ Thread.sleep(1000); String msg = ex.exchange("T2 welcome"); System.out.println("t2 get msg : "+msg); }catch(Exception e){} }); t2.start(); } } 1234567891011121314151617181920212223242526 //ExchangerTest.java//javac ExchangerTest.java && java ExchangerTest import java.util.concurrent.*; class ExchangerTest{ public static void main(String[] argv){ Exchanger<String> ex = new Exchanger<>(); Thread t1 = new Thread(()->{ try{ String msg = ex.exchange("T1 welcome"); System.out.println("t1 get msg : "+msg); }catch(Exception e){} }); t1.start(); Thread t2 = new Thread(()->{ try{ Thread.sleep(1000); String msg = ex.exchange("T2 welcome"); System.out.println("t2 get msg : "+msg); }catch(Exception e){} }); t2.start(); }} … Read More
wildfly swarm docker 部署报错 Could not start ‘default’ listener. 2017年9月13日 | Leave a comment 问题: wildfly swarm jar 在本地时好的,但是把jar 部署到docker 运行就报错 Cou… Read More
RMI bind java.rmi.UnmarshalException: java.lang.ClassNotFoundException 2017年9月6日 | Leave a comment 问题: rmi registry.bind exception [crayon-6… Read More
RMI InitialContext.bind throw javax.naming.ServiceUnavailableException 2017年9月6日 | Leave a comment 问题: RMI InitialContext.bind throw javax.naming.ServiceU… Read More
Dubbo 打包成jar的问题 2017年9月6日 | Leave a comment 问题: 使用 mvn clean install assmbly:single 1 mvn clean install assmbly:single 打包后运行老是报错  … Read More
Java wait() notify() demo 2017年9月5日 | Leave a comment 问题: 解决: 以下代码演示了在主线程中输入 0 /1 /2 控制线程的运行暂停退… Read More