Interface IGlobalPoolStrategy
-
- All Known Implementing Classes:
ConstantGlobalPoolStrategy
public interface IGlobalPoolStrategyInterface for a global pool strategy. Allows for: - worker management - proxy configuration
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetDesiredWorkerCount()Get the desired worker cnt.intgetWorkerCount()Get the worker cnt.intgetWorkersPerProxy()Get the number of workers that should be used by each proxy.longgetWorkerTimeout()Get the component timeout.booleanisCreateWorkerOn(IComponentIdentifier cid)Ask strategy if a new worker should be added on a platform.voidworkersAdded(IComponentIdentifier... workers)Called when workers have been created.voidworkersRemoved(IComponentIdentifier... workers)Called when workers have been removed.booleanworkerTimeoutOccurred(IComponentIdentifier worker)Notify the strategy that a timeout for a worker component has occurred, i.e.
-
-
-
Method Detail
-
workersAdded
void workersAdded(IComponentIdentifier... workers)
Called when workers have been created.- Parameters:
workers- The workers.
-
workersRemoved
void workersRemoved(IComponentIdentifier... workers)
Called when workers have been removed.- Parameters:
workers- The workers.
-
workerTimeoutOccurred
boolean workerTimeoutOccurred(IComponentIdentifier worker)
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.
-
getWorkerTimeout
long getWorkerTimeout()
Get the component timeout.- Returns:
- The timeout for the component to wait for new workers in the pool.
-
getWorkerCount
int getWorkerCount()
Get the worker cnt.
-
getDesiredWorkerCount
int getDesiredWorkerCount()
Get the desired worker cnt.
-
isCreateWorkerOn
boolean isCreateWorkerOn(IComponentIdentifier cid)
Ask strategy if a new worker should be added on a platform.- Parameters:
cid- The platform.- Returns:
- True, if worker should be created.
-
getWorkersPerProxy
int getWorkersPerProxy()
Get the number of workers that should be used by each proxy.- Returns:
- The number of workers used by each proxy.
-
-