Package io.atomix.utils.concurrent
Enum ThreadModel
- java.lang.Object
-
- java.lang.Enum<ThreadModel>
-
- io.atomix.utils.concurrent.ThreadModel
-
- All Implemented Interfaces:
Serializable,Comparable<ThreadModel>
public enum ThreadModel extends Enum<ThreadModel>
Raft thread model.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description SHARED_THREAD_POOLA thread model that creates a thread pool to be shared by all services.THREAD_PER_SERVICEA thread model that creates a thread for each Raft service.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract ThreadContextFactoryfactory(String nameFormat, int threadPoolSize, org.slf4j.Logger logger)Returns a thread context factory.static ThreadModelvalueOf(String name)Returns the enum constant of this type with the specified name.static ThreadModel[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SHARED_THREAD_POOL
public static final ThreadModel SHARED_THREAD_POOL
A thread model that creates a thread pool to be shared by all services.
-
THREAD_PER_SERVICE
public static final ThreadModel THREAD_PER_SERVICE
A thread model that creates a thread for each Raft service.
-
-
Method Detail
-
values
public static ThreadModel[] 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 (ThreadModel c : ThreadModel.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ThreadModel 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
-
factory
public abstract ThreadContextFactory factory(String nameFormat, int threadPoolSize, org.slf4j.Logger logger)
Returns a thread context factory.- Parameters:
nameFormat- the thread name formatthreadPoolSize- the thread pool sizelogger- the thread logger- Returns:
- the thread context factory
-
-