org.apache.catalina.cluster.util
Class FastQueue

java.lang.Object
  extended byorg.apache.catalina.cluster.util.FastQueue
All Implemented Interfaces:
IQueue

public class FastQueue
extends java.lang.Object
implements IQueue

Author:
peter TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates

Constructor Summary
FastQueue()
          Generate Queue SingleRemoveSynchronizedAddLock and set add and wait Timeouts
 
Method Summary
 boolean add(java.lang.String key, java.lang.Object data)
           
 long getAddCounter()
           
 long getAddErrorCounter()
           
 long getAddWait()
           
 long getAddWaitTimeout()
          get current add wait timeout
 long getAvgSize()
          Avg queue size
 long getAvgSizeSample()
           
 int getMaxQueueLength()
           
 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()
           
 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

FastQueue

public FastQueue()
Generate Queue SingleRemoveSynchronizedAddLock and set add and wait Timeouts

Method Detail

getAddWaitTimeout

public long getAddWaitTimeout()
get current add wait timeout

Returns:
current wait timeout

setAddWaitTimeout

public void setAddWaitTimeout(long timeout)
Set add wait timeout (default 10000 msec)

Parameters:
timeout -

getRemoveWaitTimeout

public long getRemoveWaitTimeout()
get current remove wait timeout

Returns:

setRemoveWaitTimeout

public void setRemoveWaitTimeout(long timeout)
set remove wait timeout ( default 30000 msec)

Parameters:
timeout -

getMaxQueueLength

public int getMaxQueueLength()
Specified by:
getMaxQueueLength in interface IQueue

setMaxQueueLength

public void setMaxQueueLength(int length)
Specified by:
setMaxQueueLength in interface IQueue

isEnabled

public boolean isEnabled()

setEnabled

public void setEnabled(boolean enable)

isCheckLock

public boolean isCheckLock()

setCheckLock

public void setCheckLock(boolean checkLock)

isDoStats

public boolean isDoStats()

setDoStats

public void setDoStats(boolean doStats)

isTimeWait

public boolean isTimeWait()

setTimeWait

public void setTimeWait(boolean timeWait)

getSampleInterval

public int getSampleInterval()

setSampleInterval

public void setSampleInterval(int interval)

getAddCounter

public long getAddCounter()

setAddCounter

public void setAddCounter(long counter)

getAddErrorCounter

public long getAddErrorCounter()

setAddErrorCounter

public void setAddErrorCounter(long counter)

getRemoveCounter

public long getRemoveCounter()

setRemoveCounter

public void setRemoveCounter(long counter)

getRemoveErrorCounter

public long getRemoveErrorCounter()

setRemoveErrorCounter

public void setRemoveErrorCounter(long counter)

getAddWait

public long getAddWait()

setAddWait

public void setAddWait(long wait)

getRemoveWait

public long getRemoveWait()

setRemoveWait

public void setRemoveWait(long wait)

getMaxSize

public int getMaxSize()
Returns:

setMaxSize

public void setMaxSize(int size)
Parameters:
size -

getAvgSize

public long getAvgSize()
Avg queue size

Returns:

resetStatistics

public void resetStatistics()
reset all stats data


unlockAdd

public void unlockAdd()
unlock queue for next add


unlockRemove

public void unlockRemove()
unlock queue for next remove


start

public void start()
start queuing

Specified by:
start in interface IQueue

stop

public void stop()
start queuing

Specified by:
stop in interface IQueue

getSample

public long getSample()

getMaxSizeSample

public int getMaxSizeSample()

setMaxSizeSample

public void setMaxSizeSample(int size)

getAvgSizeSample

public long getAvgSizeSample()

getSize

public int getSize()

add

public boolean add(java.lang.String key,
                   java.lang.Object data)
Specified by:
add in interface IQueue

remove

public LinkObject remove()
Specified by:
remove in interface IQueue


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.