Class NettyRuntime.AvailableProcessorsHolder
java.lang.Object
io.netty.util.NettyRuntime.AvailableProcessorsHolder
- Enclosing class:
NettyRuntime
static class NettyRuntime.AvailableProcessorsHolder
extends java.lang.Object
Holder class for available processors to enable testing.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) intGet the configured number of available processors.(package private) voidsetAvailableProcessors(int availableProcessors) Set the number of available processors.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
availableProcessors
private int availableProcessors
-
-
Constructor Details
-
AvailableProcessorsHolder
AvailableProcessorsHolder()
-
-
Method Details
-
setAvailableProcessors
void setAvailableProcessors(int availableProcessors) Set the number of available processors.- Parameters:
availableProcessors- the number of available processors- Throws:
java.lang.IllegalArgumentException- if the specified number of available processors is non-positivejava.lang.IllegalStateException- if the number of available processors is already configured
-
availableProcessors
int availableProcessors()Get the configured number of available processors. The default isRuntime.availableProcessors(). This can be overridden by setting the system property "io.netty.availableProcessors" or by invokingsetAvailableProcessors(int)before any calls to this method.- Returns:
- the configured number of available processors
-