Examples of attempt()


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

            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

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

        // 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

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

            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

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

        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

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

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

   /**
 
View Full Code Here

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

                }
            }
        });
        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

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

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

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

            // Give them 500 ms per loop
            maxElapsed = System.currentTimeMillis() + (500 * LOOP_COUNT);
            for (int i = 0; i <= count; i++)
            {
               long waitTime = maxElapsed - System.currentTimeMillis();
               assertTrue("Acquired thread " + i, semaphore.attempt(waitTime));
            }
           
            reacquired = true;
           
            // Ensure there were no exceptions
View Full Code Here

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

            // Give them 500 ms per loop
            maxElapsed = System.currentTimeMillis() + (500 * LOOP_COUNT);
            for (int i = 0; i <= count; i++)
            {
               long waitTime = maxElapsed - System.currentTimeMillis();
               assertTrue("Acquired thread " + i, semaphore.attempt(waitTime));
            }
           
            reacquired = true;
           
            // Ensure there were no exceptions
View Full Code Here

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

         TestingUtil.sleepThread(1000);
        
         // Reacquire the semaphore tickets; when we have them all
         // we know the threads are done        
         for (int i = 0; i < count; i++) {
            boolean acquired = semaphore.attempt(60000);
            if (!acquired)
               fail("failed to acquire semaphore " + i);
         }

         // Sleep to allow any async calls to clear
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.