|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.catalina.cluster.util.FastQueue
A fast queue that remover thread lock the adder thread.
Limit the queue
length when you have strange producer thread problemes.
FIXME add i18n support to log messages
Constructor Summary | |
FastQueue()
Generate Queue SingleRemoveSynchronizedAddLock and set add and wait Timeouts |
Method Summary | |
boolean |
add(java.lang.String key,
java.lang.Object data)
Add new data to the queue |
long |
getAddCounter()
|
long |
getAddErrorCounter()
|
long |
getAddWait()
|
long |
getAddWaitTimeout()
get current add wait timeout |
long |
getAvgSize()
Avg queue size |
long |
getAvgSizeSample()
|
int |
getMaxQueueLength()
get Max Queue length |
int |
getMaxSize()
|
int |
getMaxSizeSample()
|
long |
getRemoveCounter()
|
long |
getRemoveErrorCounter()
|
long |
getRemoveWait()
|
long |
getRemoveWaitTimeout()
get current remove wait timeout |
long |
getSample()
|
int |
getSampleInterval()
|
int |
getSize()
|
boolean |
isCheckLock()
|
boolean |
isDoStats()
|
boolean |
isEnabled()
|
boolean |
isTimeWait()
|
LinkObject |
remove()
remove the complete queued object list |
void |
resetStatistics()
reset all stats data |
void |
setAddCounter(long counter)
|
void |
setAddErrorCounter(long counter)
|
void |
setAddWait(long wait)
|
void |
setAddWaitTimeout(long timeout)
Set add wait timeout (default 10000 msec) |
void |
setCheckLock(boolean checkLock)
|
void |
setDoStats(boolean doStats)
|
void |
setEnabled(boolean enable)
|
void |
setMaxQueueLength(int length)
|
void |
setMaxSize(int size)
|
void |
setMaxSizeSample(int size)
|
void |
setRemoveCounter(long counter)
|
void |
setRemoveErrorCounter(long counter)
|
void |
setRemoveWait(long wait)
|
void |
setRemoveWaitTimeout(long timeout)
set remove wait timeout ( default 30000 msec) |
void |
setSampleInterval(int interval)
|
void |
setTimeWait(boolean timeWait)
|
void |
start()
start queuing |
void |
stop()
start queuing |
void |
unlockAdd()
unlock queue for next add |
void |
unlockRemove()
unlock queue for next remove |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FastQueue()
Method Detail |
public long getAddWaitTimeout()
public void setAddWaitTimeout(long timeout)
timeout
- public long getRemoveWaitTimeout()
public void setRemoveWaitTimeout(long timeout)
timeout
- public int getMaxQueueLength()
getMaxQueueLength
in interface IQueue
IQueue.getMaxQueueLength()
public void setMaxQueueLength(int length)
setMaxQueueLength
in interface IQueue
public boolean isEnabled()
public void setEnabled(boolean enable)
public boolean isCheckLock()
public void setCheckLock(boolean checkLock)
checkLock
- The checkLock to set.public boolean isDoStats()
public void setDoStats(boolean doStats)
doStats
- The doStats to set.public boolean isTimeWait()
public void setTimeWait(boolean timeWait)
timeWait
- The timeWait to set.public int getSampleInterval()
public void setSampleInterval(int interval)
public long getAddCounter()
public void setAddCounter(long counter)
public long getAddErrorCounter()
public void setAddErrorCounter(long counter)
public long getRemoveCounter()
public void setRemoveCounter(long counter)
public long getRemoveErrorCounter()
public void setRemoveErrorCounter(long counter)
public long getAddWait()
public void setAddWait(long wait)
public long getRemoveWait()
public void setRemoveWait(long wait)
public int getMaxSize()
public void setMaxSize(int size)
size
- public long getAvgSize()
public void resetStatistics()
public void unlockAdd()
public void unlockRemove()
public void start()
start
in interface IQueue
public void stop()
stop
in interface IQueue
public long getSample()
public int getMaxSizeSample()
public void setMaxSizeSample(int size)
public long getAvgSizeSample()
public int getSize()
public boolean add(java.lang.String key, java.lang.Object data)
add
in interface IQueue
FIXME extract some method
public LinkObject remove()
remove
in interface IQueue
FIXME extract some method
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |