摘要:
一、框架代码的实现使用Socket是最完美的的远程连接超时设置技术,下面是创建Socket对象的代码: 建立连接一般的写法是:Socket s = new Socket(host, port); 而要定制超时的写法则为:SocketAddress addr = new InetSocketAddress(host, port);Socket s = new Socket();s.connect(addr, timeoutInMilliSeconds);这种写法使用了底层的socket技术。如果使用JMX远程管理API, 通常不能访问socket。如果一定要使用这种技术的话,需颇费一番周折。其工 阅读全文
摘要:
ManagementFactory.getPlatformMBeanServer() returns a reference to the existing MBean server within the JVM. JConsole looks at the beans on that server.If you use createMBeanServer(), that will create an entirely new server. JConsole has no knowledge of it, and so will not see the beans registered wi 阅读全文
摘要:
http://lindows.iteye.com/blog/456641 http://code.google.com/p/javasimon/downloads/list 阅读全文
摘要:
publicclassSort{publiclong[]array;//冒泡排序publicvoidbublingSort(long[]array){intlength=array.length;longtemp;for(inti=length;i>0;i--){for(intj=0;j<i-1;j++){if(array[j]>array[j+1]){temp=array[j+1];array[j+1]=array[j];array[j]=temp;}}}}//选择排序publicvoidselectSort(long[]array){intlength=array.len 阅读全文