Class CreditsSemaphore
- java.lang.Object
-
- org.apache.activemq.artemis.protocol.amqp.util.CreditsSemaphore
-
public class CreditsSemaphore extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description CreditsSemaphore(int initialCredits)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacquire()intgetCredits()booleanhasQueuedThreads()voidrelease()voidrelease(int credits)voidsetCredits(int credits)booleantryAcquire()
-
-
-
Method Detail
-
acquire
public void acquire() throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
tryAcquire
public boolean tryAcquire()
-
release
public void release() throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
release
public void release(int credits) throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
setCredits
public void setCredits(int credits)
-
getCredits
public int getCredits()
-
hasQueuedThreads
public boolean hasQueuedThreads()
-
-