Package de.learnlib.oracle.parallelism
Enum ThreadPool.PoolPolicy
- java.lang.Object
-
- java.lang.Enum<ThreadPool.PoolPolicy>
-
- de.learnlib.oracle.parallelism.ThreadPool.PoolPolicy
-
- All Implemented Interfaces:
Serializable
,Comparable<ThreadPool.PoolPolicy>
- Enclosing interface:
- ThreadPool
public static enum ThreadPool.PoolPolicy extends Enum<ThreadPool.PoolPolicy>
The policy for dealing with thread pools.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ThreadPool.PoolPolicy
valueOf(String name)
Returns the enum constant of this type with the specified name.static ThreadPool.PoolPolicy[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
FIXED
public static final ThreadPool.PoolPolicy FIXED
Maintain a fixed thread pool. The threads will be started immediately, and will terminate only ifThreadPool.shutdown()
orThreadPool.shutdownNow()
are called.- See Also:
Executors.newFixedThreadPool(int)
-
CACHED
public static final ThreadPool.PoolPolicy CACHED
Maintain a "cached" thread pool. Threads will be created on-demand, but will be kept alive for re-use when all jobs are processed. However, they will be terminated when they have been idle for 60 seconds.Note that as opposed to
Executors.newCachedThreadPool()
, the specified pool size will never be exceeded.- See Also:
Executors.newCachedThreadPool()
-
-
Method Detail
-
values
public static ThreadPool.PoolPolicy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ThreadPool.PoolPolicy c : ThreadPool.PoolPolicy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ThreadPool.PoolPolicy valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
-