Package net.sf.eBus.config
Enum ThreadAffinityConfigure.AffinityType
- java.lang.Object
-
- java.lang.Enum<ThreadAffinityConfigure.AffinityType>
-
- net.sf.eBus.config.ThreadAffinityConfigure.AffinityType
-
- All Implemented Interfaces:
Serializable,Comparable<ThreadAffinityConfigure.AffinityType>
- Enclosing class:
- ThreadAffinityConfigure
public static enum ThreadAffinityConfigure.AffinityType extends Enum<ThreadAffinityConfigure.AffinityType>
These affinity types map to a specificAffinityLock staticmethod used to acquire an affinity lock.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ANY_COREUseAffinityLock.acquireCore()to assign any free core to thread.ANY_CPUUseAffinityLock.acquireLock()to assign any free CPU to thread.CPU_IDUseAffinityLock.acquireLock(int cpuIdto assign a CPU with specified identifier to thread.CPU_LAST_MINUSUseAffinityLock.acquireLockLastMinus(int nto allocate a CPU from the end of the core set based on the given positive number.CPU_STRATEGIESUseAffinityLock.acquireLock(AffinityStrategies...)to assign a CPU for thread affinity.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ThreadAffinityConfigure.AffinityTypevalueOf(String name)Returns the enum constant of this type with the specified name.static ThreadAffinityConfigure.AffinityType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ANY_CORE
public static final ThreadAffinityConfigure.AffinityType ANY_CORE
UseAffinityLock.acquireCore()to assign any free core to thread.
-
ANY_CPU
public static final ThreadAffinityConfigure.AffinityType ANY_CPU
UseAffinityLock.acquireLock()to assign any free CPU to thread.
-
CPU_LAST_MINUS
public static final ThreadAffinityConfigure.AffinityType CPU_LAST_MINUS
UseAffinityLock.acquireLockLastMinus(int nto allocate a CPU from the end of the core set based on the given positive number. Requires propertyCPU indexis set.
-
CPU_ID
public static final ThreadAffinityConfigure.AffinityType CPU_ID
UseAffinityLock.acquireLock(int cpuIdto assign a CPU with specified identifier to thread. Requires CPU identifier is set.
-
CPU_STRATEGIES
public static final ThreadAffinityConfigure.AffinityType CPU_STRATEGIES
UseAffinityLock.acquireLock(AffinityStrategies...)to assign a CPU for thread affinity. Selects a CPU for thread affinity based on the given selection strategies. Requires selectionstrategy typesare set. Strategy order is significant andAffinityStrategies.ANYmust be the final strategy type.
-
-
Method Detail
-
values
public static ThreadAffinityConfigure.AffinityType[] 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 (ThreadAffinityConfigure.AffinityType c : ThreadAffinityConfigure.AffinityType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ThreadAffinityConfigure.AffinityType 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
-
-