JTR 5.0 API Documentation

jtr.pool
Class RunnerPool

java.lang.Object
  extended by jtr.pool.RunnerPool

public class RunnerPool
extends java.lang.Object

This class represents a pool of IRunner instances.
Only IRunnerParameterized instances are allowed to be added to the pool, and once added they all become IRunnerPooled. Only IRunnerPooled instances are elegible for execution.

Since:
1.0
Version:
5.0
Author:
Francesco Russo (frusso@dev.java.net)

Constructor Summary
RunnerPool(IPoolManager poolManager)
          Costructor.
 
Method Summary
 IRunnerPooled add(IRunnerParameterized runner)
          Adds an IRunnerParameterized to the current pool.
 IRunnerPooled[] addAll(IRunnerParameterized[] runners)
          Adds a set of IRunnerParameterized to the current pool.
 IPoolManager getPoolManager()
          Gets the IPoolManager in charge of managing this pool.
 IRunnerPooled remove(int index)
          Removes the IRunnerPooled allocated at the provided index.
 IRunnerPooled[] removeAll()
          Make the pool empty and returns all the removed entries.
 void setPoolManager(IPoolManager poolManager)
          Sets the IPoolManager in charge of managing this pool.
 int size()
          Returns the actual size of the pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RunnerPool

public RunnerPool(IPoolManager poolManager)
Costructor. Requires the reference to the pool manager that will manage the pool.

Parameters:
poolManager - IPoolManager
Method Detail

add

public IRunnerPooled add(IRunnerParameterized runner)
Adds an IRunnerParameterized to the current pool.

Parameters:
runner - IRunnerParameterized
Returns:
IRunnerPooled

addAll

public IRunnerPooled[] addAll(IRunnerParameterized[] runners)
Adds a set of IRunnerParameterized to the current pool.

Parameters:
runners - IRunnerParameterized[]
Returns:
IRunnerPooled[]

remove

public IRunnerPooled remove(int index)
Removes the IRunnerPooled allocated at the provided index.

Parameters:
index - int
Returns:
IRunnerPooled

removeAll

public IRunnerPooled[] removeAll()
Make the pool empty and returns all the removed entries.

Returns:
IRunnerPooled[]

getPoolManager

public IPoolManager getPoolManager()
Gets the IPoolManager in charge of managing this pool.

Returns:
IPoolManager

setPoolManager

public void setPoolManager(IPoolManager poolManager)
Sets the IPoolManager in charge of managing this pool.

Parameters:
poolManager - IPoolManager

size

public int size()
Returns the actual size of the pool.

Returns:
int

The JTR Project is licensed under GPL version 2