Package net.sf.eBus.config
Class ENetConfigure.SelectorInfo
- java.lang.Object
-
- net.sf.eBus.config.ENetConfigure.SelectorInfo
-
- All Implemented Interfaces:
Comparable<ENetConfigure.SelectorInfo>
- Enclosing class:
- ENetConfigure
public static final class ENetConfigure.SelectorInfo extends Object implements Comparable<ENetConfigure.SelectorInfo>
This immutable class contains the selector thread configuration for the named selector. This includes:- a unique selector name,
-
the selector
thread type, - a flag specifying whether this is the default selector or not,
-
the spin limit used for
ThreadType.SPINPARKandThreadType.SPINYIELDselectors, and -
the nanosecond park time limit used for
ThreadType.SPINPARKselectors.
An example
SelectorInfoconfiguration follows:name : s1 type : "spin+park" isDefault : true priority : 7 spinLimit : 1000000 parkTime : 500ns
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ThreadAffinityConfigureaffinity()Returns thread affinity andnullif no affinity is set.intcompareTo(ENetConfigure.SelectorInfo selector)Comparesthisobject with the specified selector.booleanequals(Object o)Returnstrueifthisobject equalsoandfalseotherwise.inthashCode()Returns a hash code for this object.booleanisDefault()Returnstrueif this user-defined selector thread is the default selector.Stringname()Returns the unique selector thread name.DurationparkTime()Returns the spin+park park time limit.intpriority()Returns the selector thread priority.longspinLimit()Returns a spin+parkESelectorspin limit.StringtoString()Returns a string representation of this selector info.ThreadTypetype()Returns theESelectortype.
-
-
-
Method Detail
-
compareTo
public int compareTo(ENetConfigure.SelectorInfo selector)
Comparesthisobject with the specified selector. Returns negative, zero, or positive integer value based on whetherthisobject is <, equal to, or >selector. Comparison is based on on the selector name.- Specified by:
compareToin interfaceComparable<ENetConfigure.SelectorInfo>- Parameters:
selector- object used in the comparison.- Returns:
- a negative, zero, or positive integer value.
-
equals
public boolean equals(Object o)
Returnstrueifthisobject equalsoandfalseotherwise. Comparison is based on the name, thread type, "is default" flag, thread priority, spin limit and park time.
-
hashCode
public int hashCode()
Returns a hash code for this object. The hash is based on the selector name, thread type, "is default" flag, thread priority, spin limit, and park time.
-
toString
public String toString()
Returns a string representation of this selector info.
-
name
public String name()
Returns the unique selector thread name.- Returns:
- selector thread name.
-
type
public ThreadType type()
Returns theESelectortype.- Returns:
- selector type.
-
isDefault
public boolean isDefault()
Returnstrueif this user-defined selector thread is the default selector.- Returns:
trueif the default selector thread.
-
priority
public int priority()
Returns the selector thread priority.- Returns:
- thread priority.
-
spinLimit
public long spinLimit()
Returns a spin+parkESelectorspin limit.- Returns:
- spin limit.
-
parkTime
public Duration parkTime()
Returns the spin+park park time limit.- Returns:
- park time limit.
-
affinity
public ThreadAffinityConfigure affinity()
Returns thread affinity andnullif no affinity is set. This affinity is used to associate a thread with a particular CPU.- Returns:
- thread affinity.
-
-