Package EDU.oswego.cs.dl.util.concurrent

Examples of EDU.oswego.cs.dl.util.concurrent.Latch.attempt()


        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        MessageProducer producer = session.createProducer(new ActiveMQQueue("TEST"));
        producer.send(session.createTextMessage("Hello"));

        assertTrue(messageDelivered.attempt(1000 * 5));
    }

}
View Full Code Here


        Registry registry = getRegistry();
        assertNotNull(registry);

        server.shutdown();

        if (!latch.attempt(10 * 1000)) {
            fail("CallerListener not notified of disconnection");
        }
    }

    /**
 
View Full Code Here

        service.addCallback(callbackProxy);

        assertNull(serviceImpl.getException());
        client.shutdown();

        if (!latch.attempt(10 * 1000)) {
            fail("CallerListener not notified of disconnection");
        }
        assertNull(serviceImpl.getException());
    }

View Full Code Here

        // make sure the connection isn't reaped through inactivity
        // while there are proxies associated with it.
        for (int i = 0; i < 10; ++i) {
            Runtime.getRuntime().gc();
            if (latch.attempt(1000)) {
                break;
            }
        }
        if (latch.attempt(0)) {
            fail("Connection terminated when there were active proxies");
View Full Code Here

            Runtime.getRuntime().gc();
            if (latch.attempt(1000)) {
                break;
            }
        }
        if (latch.attempt(0)) {
            fail("Connection terminated when there were active proxies");
        }

        // clear registry proxy and ensure the connection isn't reaped.
        // Registry proxy is constructed differently to those serialized
View Full Code Here

        // over the wire.

        registry = null;
        for (int i = 0; i < 10; ++i) {
            Runtime.getRuntime().gc();
            if (latch.attempt(1000)) {
                break;
            }
        }
        if (latch.attempt(0)) {
            fail("Connection terminated when there were active proxies");
View Full Code Here

            Runtime.getRuntime().gc();
            if (latch.attempt(1000)) {
                break;
            }
        }
        if (latch.attempt(0)) {
            fail("Connection terminated when there were active proxies");
        }

        // clear proxy reference so the connection can be GC'ed
        service = null;
View Full Code Here

        service = null;

        // wait for the notification. Need to force the GC to run...
        for (int i = 0; i < 10; ++i) {
            Runtime.getRuntime().gc();
            if (latch.attempt(1000)) {
                break;
            }
        }
        if (!latch.attempt(0)) {
            fail("CallerListener not notified of disconnection");
View Full Code Here

            Runtime.getRuntime().gc();
            if (latch.attempt(1000)) {
                break;
            }
        }
        if (!latch.attempt(0)) {
            fail("CallerListener not notified of disconnection");
        }
    }

   /**
 
View Full Code Here

                }
            }
        });
        connection.start();
       
        if( doneLatch.attempt(1000*5) ) {
            if( errorMessage[0]!=null ) {
                fail(errorMessage[0]);
            }           
        } else {
            fail("Timeout waiting for async message delivery to complete.");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.