com.unboundid.scim.wink
Class AdjustableSemaphore

java.lang.Object
  extended by java.util.concurrent.Semaphore
      extended by com.unboundid.scim.wink.AdjustableSemaphore
All Implemented Interfaces:
Serializable

public final class AdjustableSemaphore
extends Semaphore

A semaphore that can be dynamically resized.

See Also:
Serialized Form

Constructor Summary
AdjustableSemaphore(int maxPermits)
          Create a new instance of this semaphore.
 
Method Summary
 int availablePermits()
          
 int getMaxPermits()
          Retrieves the maximum number of permits.
 void setMaxPermits(int maxPermits)
          Set the maximum number of permits.
 
Methods inherited from class java.util.concurrent.Semaphore
acquire, acquire, acquireUninterruptibly, acquireUninterruptibly, drainPermits, getQueuedThreads, getQueueLength, hasQueuedThreads, isFair, reducePermits, release, release, toString, tryAcquire, tryAcquire, tryAcquire, tryAcquire
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AdjustableSemaphore

public AdjustableSemaphore(int maxPermits)
Create a new instance of this semaphore.

Parameters:
maxPermits - The initial number of permits.
Method Detail

getMaxPermits

public int getMaxPermits()
Retrieves the maximum number of permits.

Returns:
The maximum number of permits.

availablePermits

public int availablePermits()

Overrides:
availablePermits in class Semaphore

setMaxPermits

public void setMaxPermits(int maxPermits)
Set the maximum number of permits.

Parameters:
maxPermits - The maximum number of permits. Must be greater than zero.


Copyright © 2011-2012 UnboundID. All Rights Reserved.