com.alee.extended.tree
Class AsyncTreeQueue

java.lang.Object
  extended by com.alee.extended.tree.AsyncTreeQueue

public final class AsyncTreeQueue
extends java.lang.Object

Asynchronous tree childs loading queue.

Author:
Mikle Garin

Field Summary
static boolean separateLimitForEachTree
          Whether to use threads mount limit for each separate asynchronous tree or for all existing asynchronous trees.
static int threadsAmount
          Maximum threads amount to run all asynchronous trees requests in.
 
Method Summary
 void execute(java.lang.Runnable runnable)
          Executes runnable using this queue.
static void execute(WebAsyncTree asyncTree, java.lang.Runnable runnable)
          Executes runnable using queue for the specified asynchronous tree.
static AsyncTreeQueue getInstance(WebAsyncTree asyncTree)
          Returns an instance of queue for the specified asynchronous tree.
 void setMaximumThreadsAmount(int amount)
          Sets maximum threads amount for this queue.
static void setMaximumThreadsAmount(WebAsyncTree asyncTree, int amount)
          Sets maximum threads amount for the specified asynchronous tree.
 void shutdown()
          Shutdowns this queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

threadsAmount

public static int threadsAmount
Maximum threads amount to run all asynchronous trees requests in. You can set this to zero to disable thread limit.


separateLimitForEachTree

public static boolean separateLimitForEachTree
Whether to use threads mount limit for each separate asynchronous tree or for all existing asynchronous trees.

Method Detail

setMaximumThreadsAmount

public static void setMaximumThreadsAmount(WebAsyncTree asyncTree,
                                           int amount)
Sets maximum threads amount for the specified asynchronous tree.

Parameters:
asyncTree - asynchronous tree to process
amount - new maximum threads amount

execute

public static void execute(WebAsyncTree asyncTree,
                           java.lang.Runnable runnable)
Executes runnable using queue for the specified asynchronous tree.

Parameters:
asyncTree - asynchronous tree to process
runnable - runnable to execute

getInstance

public static AsyncTreeQueue getInstance(WebAsyncTree asyncTree)
Returns an instance of queue for the specified asynchronous tree. This method might return the same queue for all trees depending on "separateLimitForEachTree" variable value.

Parameters:
asyncTree - asynchronous tree to process
Returns:
an instance of queue for the specified asynchronous tree

setMaximumThreadsAmount

public void setMaximumThreadsAmount(int amount)
Sets maximum threads amount for this queue.

Parameters:
amount - maximum threads amount for this queue

shutdown

public void shutdown()
Shutdowns this queue.


execute

public void execute(java.lang.Runnable runnable)
Executes runnable using this queue.

Parameters:
runnable - runnable to execute