com.datumbox.framework.common.concurrency
Class ConcurrencyConfiguration
- java.lang.Object
-
- com.datumbox.framework.common.concurrency.ConcurrencyConfiguration
-
- All Implemented Interfaces:
- Configurable
public class ConcurrencyConfiguration extends java.lang.Object implements Configurable
The ConcurrencyConfiguration class is used to store the concurrency settings of the framework.
-
-
Field Summary
Fields Modifier and Type Field and Description static intAVAILABLE_PROCESSORSThe total number of processors.
-
Constructor Summary
Constructors Constructor and Description ConcurrencyConfiguration()Protected constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.IntegergetMaxNumberOfThreadsPerTask()Returns the maximum number of threads which can be used for a specific task by the framework.booleanisParallelized()Getter for the parallelized flag.voidload(java.util.Properties properties)Initializes the Configuration object by using a property file.voidsetMaxNumberOfThreadsPerTask(java.lang.Integer maxNumberOfThreadsPerTask)Setter for the maximum number of threads which can be used for a specific task by the framework.voidsetParallelized(boolean parallelized)Setter for the parallelized flag.
-
-
-
Field Detail
-
AVAILABLE_PROCESSORS
public static final int AVAILABLE_PROCESSORS
The total number of processors.
-
-
Constructor Detail
-
ConcurrencyConfiguration
public ConcurrencyConfiguration()
Protected constructor.
-
-
Method Detail
-
isParallelized
public boolean isParallelized()
Getter for the parallelized flag.- Returns:
-
setParallelized
public void setParallelized(boolean parallelized)
Setter for the parallelized flag. This option controls whether parallel execution of threads is allowed in the framework.- Parameters:
parallelized-
-
getMaxNumberOfThreadsPerTask
public java.lang.Integer getMaxNumberOfThreadsPerTask()
Returns the maximum number of threads which can be used for a specific task by the framework.- Returns:
-
setMaxNumberOfThreadsPerTask
public void setMaxNumberOfThreadsPerTask(java.lang.Integer maxNumberOfThreadsPerTask)
Setter for the maximum number of threads which can be used for a specific task by the framework. By convention if the value is 0, the max number of threads is set equal to the available processors.- Parameters:
maxNumberOfThreadsPerTask-
-
load
public void load(java.util.Properties properties)
Initializes the Configuration object by using a property file.- Specified by:
loadin interfaceConfigurable
-
-
DataMelt 3.0 © DataMelt by jWork.ORG