org.xsocket
Class DynamicWorkerPool

Package class diagram package DynamicWorkerPool
java.lang.Object
  extended by org.xsocket.DynamicWorkerPool
All Implemented Interfaces:
java.util.concurrent.Executor, IWorkerPool

Deprecated. use a ThreadPool implementation of java.util.concurrent package (Executor) instead

public final class DynamicWorkerPool
extends java.lang.Object
implements IWorkerPool


Field Summary
static int DEFAULT_ADJUST_CHECK_PERIOD
          Deprecated.  
static int DEFAULT_LOAD_THRESHOLD_DECREASE
          Deprecated.  
static int DEFAULT_LOAD_THRESHOLD_INCREASE
          Deprecated.  
static java.lang.String WORKER_PREFIX
          Deprecated.  
 
Constructor Summary
DynamicWorkerPool(int minSize, int maxSize)
          Deprecated.  
 
Method Summary
 void close()
          Deprecated.  
 void execute(java.lang.Runnable command)
          Deprecated. 
 int getActiveCount()
          Deprecated. 
 int getAdjustPeriod()
          Deprecated.  
 int getLoad()
          Deprecated. return the load (range: 0...100)
 int getMaximumPoolSize()
          Deprecated.  
 int getMinimumPoolSize()
          Deprecated.  
 int getPoolSize()
          Deprecated. 
 int getThresholdDecrease()
          Deprecated.  
 int getThresholdIncrease()
          Deprecated.  
<T> java.util.List<java.util.concurrent.Future<T>>
invokeAll(java.util.Collection<java.util.concurrent.Callable<T>> tasks)
          Deprecated. 
 boolean isOpen()
          Deprecated.  
 void setAdjustPeriod(int adjustPeriodSec)
          Deprecated.  
 void setThresholdDecrease(int decThreshold)
          Deprecated.  
 void setThresholdIncrease(int incThreshold)
          Deprecated.  
 java.lang.String toString()
          Deprecated. 
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WORKER_PREFIX

public static final java.lang.String WORKER_PREFIX
Deprecated. 
See Also:
Constant Field Values

DEFAULT_LOAD_THRESHOLD_DECREASE

public static final int DEFAULT_LOAD_THRESHOLD_DECREASE
Deprecated. 
See Also:
Constant Field Values

DEFAULT_LOAD_THRESHOLD_INCREASE

public static final int DEFAULT_LOAD_THRESHOLD_INCREASE
Deprecated. 
See Also:
Constant Field Values

DEFAULT_ADJUST_CHECK_PERIOD

public static final int DEFAULT_ADJUST_CHECK_PERIOD
Deprecated. 
See Also:
Constant Field Values
Constructor Detail

DynamicWorkerPool

public DynamicWorkerPool(int minSize,
                         int maxSize)
Deprecated. 
Parameters:
minSize - the min pool size (and the initial size)
maxSize - the max pool size
Method Detail

execute

public void execute(java.lang.Runnable command)
Deprecated. 

Specified by:
execute in interface java.util.concurrent.Executor
Specified by:
execute in interface IWorkerPool
Parameters:
command - the commnd to execute

invokeAll

public <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<java.util.concurrent.Callable<T>> tasks)
                                                         throws java.lang.InterruptedException
Deprecated. 

Specified by:
invokeAll in interface IWorkerPool
Parameters:
tasks - the collection of tasks
Returns:
A list of Futures representing the tasks, in the same sequential order as produced by the iterator for the given task list, each of which has completed.
Throws:
java.lang.InterruptedException - if interrupted while waiting, in which case unfinished tasks are cancelled.

getActiveCount

public int getActiveCount()
Deprecated. 

Specified by:
getActiveCount in interface IWorkerPool
Returns:
the number of workes

getPoolSize

public int getPoolSize()
Deprecated. 

Specified by:
getPoolSize in interface IWorkerPool
Returns:
the number of the workers

getLoad

public int getLoad()
Deprecated. 
return the load (range: 0...100)

Returns:
the load

getMaximumPoolSize

public int getMaximumPoolSize()
Deprecated. 
Returns:
the maximum pool size

getMinimumPoolSize

public int getMinimumPoolSize()
Deprecated. 
Returns:
the minimum pool size

isOpen

public boolean isOpen()
Deprecated. 
Returns:
true, if the worker pool is open

close

public void close()
Deprecated. 

setAdjustPeriod

public void setAdjustPeriod(int adjustPeriodSec)
Deprecated. 
Parameters:
adjustPeriodSec - the adjust check period of the pool size in seconds

getAdjustPeriod

public int getAdjustPeriod()
Deprecated. 
Returns:
the adjust check period of the pool size in seconds

getThresholdIncrease

public int getThresholdIncrease()
Deprecated. 
Returns:
the increase threshold

setThresholdIncrease

public void setThresholdIncrease(int incThreshold)
Deprecated. 
Parameters:
incThreshold - the increase threshold

getThresholdDecrease

public int getThresholdDecrease()
Deprecated. 
Returns:
the decrease threshold

setThresholdDecrease

public void setThresholdDecrease(int decThreshold)
Deprecated. 
Parameters:
decThreshold - the decrease threshold

toString

public java.lang.String toString()
Deprecated. 

Overrides:
toString in class java.lang.Object