|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.qpid.junit.extensions.BaseThrottle
public abstract class BaseThrottle
Provides a base implementation of the non-waiting throttle checking method, using the system nano timer.
Responsibilities | Collaborations |
---|---|
Check against a throttle speed without waiting. |
Field Summary | |
---|---|
protected long |
cycleTimeNanos
Holds the length of a single cycle in nano seconds. |
(package private) boolean |
firstCall
Flag used to detect the first call to the Throttle.throttle() method. |
(package private) boolean |
firstCheckCall
Flag used to detect the first call to the checkThrottle() method. |
Constructor Summary | |
---|---|
BaseThrottle()
|
Method Summary | |
---|---|
boolean |
checkThrottle()
Checks but does not enforce the throttle rate. |
void |
setRate(float hertz)
Specifies the throttling rate in operations per second. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.qpid.junit.extensions.Throttle |
---|
throttle |
Field Detail |
---|
protected long cycleTimeNanos
boolean firstCheckCall
checkThrottle()
method.
boolean firstCall
Throttle.throttle()
method. Zero or negative start time cannot be
relied on to detect this as System.nanoTime can return zero or negative values.
Constructor Detail |
---|
public BaseThrottle()
Method Detail |
---|
public void setRate(float hertz)
setRate
in interface Throttle
hertz
- The throttling rate in cycles per second.public boolean checkThrottle()
checkThrottle
in interface Throttle
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |