Package jadex.commons
Interface IPoolStrategy
- 
- All Known Implementing Classes:
- ConstantPoolStrategy,- DefaultPoolStrategy
 
 public interface IPoolStrategyInterface for pool strategies.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetCapacity()Get the number of free workers.intgetWorkerCount()Get the worker cnt.longgetWorkerTimeout()Get the component timeout.booleantaskAdded()Called when a new task was added to the pool.booleantaskFinished()Called when a task is finished.voidtaskServed(long waitdur)Called when a new task was served from the pool.voidworkersAdded(int cnt)Called when a new worker was added proactively to the pool.booleanworkerTimeoutOccurred()Notify the strategy that a timeout for a worker component has occurred, i.e.
 
- 
- 
- 
Method Detail- 
taskAddedboolean taskAdded() Called when a new task was added to the pool.- Returns:
- True, if a new worker should be added to the pool.
 
 - 
taskServedvoid taskServed(long waitdur) Called when a new task was served from the pool.- Parameters:
- waitdur- The waiting time of the task.
 
 - 
taskFinishedboolean taskFinished() Called when a task is finished.- Returns:
- True, if executing worker should be removed from the pool.
 
 - 
workersAddedvoid workersAdded(int cnt) Called when a new worker was added proactively to the pool. Workers are automatically removed by the strategy as result of taskFinished().- Parameters:
- cnt- The number of new workers.
 
 - 
getWorkerTimeoutlong getWorkerTimeout() Get the component timeout.- Returns:
- The timeout for the component to wait for new workers in the pool.
 
 - 
workerTimeoutOccurredboolean workerTimeoutOccurred() Notify the strategy that a timeout for a worker component has occurred, i.e. it was not needed for serving some worker.- Returns:
- True, if the component be excluded from the pool.
 
 - 
getWorkerCountint getWorkerCount() Get the worker cnt.
 - 
getCapacityint getCapacity() Get the number of free workers.
 
- 
 
-