public class Credit extends Object
Modifier and Type | Field and Description |
---|---|
protected Average |
avg_blockings |
protected Condition |
credits_available |
protected long |
credits_left |
protected long |
last_credit_request |
protected Lock |
lock |
protected int |
num_blockings |
Constructor and Description |
---|
Credit(long credits) |
Credit(long credits,
Lock lock) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
decrement(long credits) |
long |
decrementAndGet(long credits,
long min_credits,
long max_credits) |
boolean |
decrementIfEnoughCredits(Message msg,
int credits,
long timeout) |
long |
get() |
double |
getAverageBlockTime() |
int |
getNumBlockings() |
void |
increment(long credits,
long max_credits) |
boolean |
needToSendCreditRequest(long max_block_time) |
void |
reset() |
String |
toString() |
protected final Lock lock
protected final Condition credits_available
protected long credits_left
protected int num_blockings
protected long last_credit_request
protected final Average avg_blockings
public Credit(long credits)
public Credit(long credits, Lock lock)
public int getNumBlockings()
public long get()
public double getAverageBlockTime()
public void reset()
public boolean decrementIfEnoughCredits(Message msg, int credits, long timeout)
public long decrementAndGet(long credits, long min_credits, long max_credits)
public void increment(long credits, long max_credits)
public boolean needToSendCreditRequest(long max_block_time)
protected boolean decrement(long credits)
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.