Examples of availablePermits()


Examples of java.util.concurrent.Semaphore.availablePermits()

              factoryBean.close();
            }

            batchContext.close();

            if(semaphore.availablePermits() == 0) {
              semaphore.release();
            }
          }
        }
      });
View Full Code Here

Examples of org.menagerie.latches.spi.ZkSemaphore.availablePermits()

        DistributedSemaphore semaphore = new ZkSemaphore(numPermits, basePath,zkSessionManager);

        semaphore.acquire();

        //check that the available permits are zero
        assertEquals("semaphore does not report fewer permits!",numPermits-1,semaphore.availablePermits());
        semaphore.release();
        assertEquals("semaphore does not report releasing a permit!",numPermits,semaphore.availablePermits());
    }

    @Test(timeout = 1000l)
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.