Apache Tomcat 7.0.28

org.apache.catalina.tribes.transport.bio.util
Class FastQueue

java.lang.Object
  extended by org.apache.catalina.tribes.transport.bio.util.FastQueue

public class FastQueue
extends Object

A fast queue that remover thread lock the adder thread.
Limit the queue length when you have strange producer thread problems. FIXME add i18n support to log messages

Version:
$Id: FastQueue.java 1222856 2011-12-23 21:21:31Z markt $
Author:
Rainer Jung, Peter Rossbach

Constructor Summary
FastQueue()
          Generate Queue SingleRemoveSynchronizedAddLock and set add and wait Timeouts
 
Method Summary
 boolean add(ChannelMessage msg, Member[] destination, InterceptorPayload payload)
          Add new data to the queue.
 long getAddWaitTimeout()
          get current add wait timeout
 SingleRemoveSynchronizedAddLock getLock()
           
 int getMaxQueueLength()
           
 int getMaxSize()
           
 long getRemoveWaitTimeout()
          get current remove wait timeout
 int getSize()
           
 boolean isCheckLock()
           
 boolean isEnabled()
           
 LinkObject remove()
          Remove the complete queued object list.
 void setAddWaitTimeout(long timeout)
          Set add wait timeout (default 10000 msec)
 void setCheckLock(boolean checkLock)
           
 void setEnabled(boolean enable)
           
 void setMaxQueueLength(int length)
           
 void setMaxSize(int size)
           
 void setRemoveWaitTimeout(long timeout)
          set remove wait timeout ( default 30000 msec)
 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:
The timeout

setRemoveWaitTimeout

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

Parameters:
timeout -

getMaxQueueLength

public int getMaxQueueLength()

setMaxQueueLength

public void setMaxQueueLength(int length)

isEnabled

public boolean isEnabled()

setEnabled

public void setEnabled(boolean enable)

isCheckLock

public boolean isCheckLock()
Returns:
Returns the checkLock.

setCheckLock

public void setCheckLock(boolean checkLock)
Parameters:
checkLock - The checkLock to set.

getMaxSize

public int getMaxSize()
Returns:
The max size

setMaxSize

public void setMaxSize(int size)
Parameters:
size -

unlockAdd

public void unlockAdd()
unlock queue for next add


unlockRemove

public void unlockRemove()
unlock queue for next remove


start

public void start()
start queuing


stop

public void stop()
start queuing


getSize

public int getSize()

getLock

public SingleRemoveSynchronizedAddLock getLock()

add

public boolean add(ChannelMessage msg,
                   Member[] destination,
                   InterceptorPayload payload)
Add new data to the queue. FIXME extract some method


remove

public LinkObject remove()
Remove the complete queued object list. FIXME extract some method


Apache Tomcat 7.0.28

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