public final class NettyRuntime
extends java.lang.Object
Runtime
.Modifier and Type | Class and Description |
---|---|
(package private) static class |
NettyRuntime.AvailableProcessorsHolder
Holder class for available processors to enable testing.
|
Modifier and Type | Field and Description |
---|---|
private static NettyRuntime.AvailableProcessorsHolder |
holder |
Modifier | Constructor and Description |
---|---|
private |
NettyRuntime()
No public constructor to prevent instances from being created.
|
Modifier and Type | Method and Description |
---|---|
static int |
availableProcessors()
Get the configured number of available processors.
|
static void |
setAvailableProcessors(int availableProcessors)
Set the number of available processors.
|
private static final NettyRuntime.AvailableProcessorsHolder holder
private NettyRuntime()
public static void setAvailableProcessors(int availableProcessors)
availableProcessors
- the number of available processorsjava.lang.IllegalArgumentException
- if the specified number of available processors is non-positivejava.lang.IllegalStateException
- if the number of available processors is already configuredpublic static int availableProcessors()
Runtime.availableProcessors()
. This
can be overridden by setting the system property "io.netty.availableProcessors" or by invoking
setAvailableProcessors(int)
before any calls to this method.