Package nl.nn.adapterframework.util
Class Guard
- java.lang.Object
-
- nl.nn.adapterframework.util.Guard
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addResource()
boolean
isReleased()
void
releaseResource()
decrements internal counter, possibly awakening the thread waiting for release wait()ing in acquire()void
waitForAllResources()
Wait for the counter to get zero.void
waitForAllResources(long timeout)
Wait for the counter to get zero.
-
-
-
Method Detail
-
waitForAllResources
public void waitForAllResources() throws InterruptedException
Wait for the counter to get zero.- Throws:
InterruptedException
- passed from this.wait().
-
waitForAllResources
public void waitForAllResources(long timeout) throws InterruptedException, TimeoutException
Wait for the counter to get zero.- Throws:
InterruptedException
- passed from this.wait().TimeoutException
- if the time specified has passed, but the counter did not reach zero.
-
addResource
public void addResource()
-
releaseResource
public void releaseResource()
decrements internal counter, possibly awakening the thread waiting for release wait()ing in acquire()
-
isReleased
public boolean isReleased()
-
-