`
文章列表
ff
f
Semaphore.acquire():最多n个运行,与Executors.newFixedThreadPool( 2 )作用相似 CyclicBarrier.await(): 加到n才开始 CountDownLatch.await(): 减到0才开始   /** * CyclicBarrier.await(): Waits until all parties have invoked await on this barrier. * @author timeriver.wang * @date Mar 10, 2014 10:43:52 AM */ public ...
Semaphore.acquire():Acquires a permit from this semaphore, blocking until one is available 与Executors.newFixedThreadPool( 2 )作用相似 CyclicBarrier.await(): Waits until all parties have invoked await on this barrier.  CountDownLatch.await(): Causes the current thread to wait until the latch has coun ...
Semaphore.acquire():Acquires a permit from this semaphore, blocking until one is available 与Executors.newFixedThreadPool( 2 )作用相似 CyclicBarrier.await(): Waits until all parties have invoked await on this barrier.  CountDownLatch.await(): Causes the current thread to wait until the latch has coun ...
/** * 3个线程,依次执行 * @author timeriver.wang * @date 2014-03-10 2:06:19 PM */ public class ThreeThreadCommunication { public static void main( String[] args ) { final Bunnies bunnies = new Bunnies(); new Thread( new Runnable() { public void run() { ...
被加锁的对象是共享数据,不是线程   1,put,get方法入口处设置断点,debug验证:可以同时有2个读线程,但最多只能有一个写线程 2,用ReentrantReadWriteLock实现线程安全的cache   /** * @author timeriver.wang * @date 2014-03-10 1:37:11 PM */ public class ReadWriteLockTest { public static void main(String[] args) { final Queue3 q3 = new Queue3(); fo ...
1,swing 优于 awt,SWT最优(Standard Widget Toolkit, Swing/AWT的非标准替代者) 2,swing框架 Object         java.awt.Component         --PropertyChangeSupport changeSupport;firePropertyChange                 java.awt.Container                         javax.swing.JComponent        窗口上的组件                         ...
1,创建接口及实现类 package com.timeriver.classloader; /** * @author rivertime.wang * @date 2014-3-9 上午10:17:04 */ public interface IPluginModule { public void helloWorld(); }   public class AModule implements IPluginModule{ @Override public void helloWorld() { System ...
方法
/** * 构造线程的2种方式,第三个线程是混合方式 * * @author timeriver.wang * @date Mar 10, 2014 3:11:05 PM */ public class TraditionThread { public static void main( String[] args ) { /** * 也可以用匿名内部类(new 父类或接口),不一定非要extends */ Thread thread = new Thread() { ...
现在只有最简单的关联映射验证,  关键点:jaxbMarshaller.setSchema( sch ); 还不会验证集合类型:List,Set,Map,以后再把JAXB(二)的例子加上,     /** * @author timeriver.wang * @date 2014-03-06 0:57:01 AM */ @XmlRootElement public class Address { private String area; private String street; @XmlElement(nam ...
  //JAXB support Collection(List,Set),does not support Map(not Collection). //XmlAdapter<ValueType,BoundType> : !use List to implement Map's feature,like (List students)!!! //<ValueType> : to be persisted format, The type that JAXB knows how to handle out of the box //<BoundType& ...
JAXB(Java Architecture for XML Binding)  主要方法:Marshaller的marshal()方法, // marshal 整理,编列,元帅的意思   /** * @author timeriver.wang * @date 2013-01-09 8:07:01 PM */ @XmlRootElement @XmlAccessorType(XmlAccessType.PROPERTY) public class Student { private String id; private String name; pub ...
转自http://technet.microsoft.com/en-us/library/bb490899.aspx,用来备份   例子: eventcreate /t error /id 100 /l application /d "Create event in application log"  eventcreate /t information /id 1000 /so winmgmt /d "Create event in WinMgmt source" eventcreate /t error /id 2001 /so winwor ...
Global site tag (gtag.js) - Google Analytics