Code example for CountDownLatch

0
 */ 
@Singleton 
@Remote(RemoteLatch.class) 
public class LatchBean implements RemoteLatch { 
 
    private static final CountDownLatch shutDownLatch = new CountDownLatch(1);
    private static final CountDownLatch messageLatch = new CountDownLatch(1);
 
    private String echoMessage;
 
    @Override 
    @Asynchronous 
    public void testDone() { 
        shutDownLatch.countDown();
    } 
 
    public static CountDownLatch getShutDownLatch() {
        return shutDownLatch;
    } 
 
    public String getEchoMessage() {