Package org.frankframework.receivers
Class ResourceLimiter
java.lang.Object
java.util.concurrent.Semaphore
org.frankframework.receivers.ResourceLimiter
- All Implemented Interfaces:
Serializable
ResourceLimiter for limiting the number of resources that can be used in parallel.
Contains a maxResourceLimit that can be increased or decreased, separate from the actual permits.
See
Semaphore for generic details.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintvoidincreaseMaxResourceCount(int addition) voidreduceMaxResourceCount(int reduction) voidMethods inherited from class java.util.concurrent.Semaphore
acquire, acquire, acquireUninterruptibly, acquireUninterruptibly, availablePermits, drainPermits, getQueuedThreads, getQueueLength, hasQueuedThreads, isFair, reducePermits, release, release, toString, tryAcquire, tryAcquire, tryAcquire, tryAcquire
-
Constructor Details
-
ResourceLimiter
public ResourceLimiter(int permits) -
ResourceLimiter
public ResourceLimiter(int permits, boolean fair)
-
-
Method Details
-
increaseMaxResourceCount
public void increaseMaxResourceCount(int addition) -
reduceMaxResourceCount
public void reduceMaxResourceCount(int reduction) -
getMaxResourceLimit
public int getMaxResourceLimit() -
waitUntilAllResourcesAvailable
- Throws:
InterruptedException
-