io.stepfunc.dnp3.RuntimeConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dnp3 Show documentation
Show all versions of dnp3 Show documentation
Safe and fast DNP3 library
// This library is provided under the terms of a non-commercial license.
//
// Please refer to the source repository for details:
//
// https://github.com/stepfunc/dnp3/blob/master/LICENSE.txt
//
// Please contact Step Function I/O if you are interested in commercial license:
//
// [email protected]
package io.stepfunc.dnp3;
import org.joou.*;
/**
* Runtime configuration
*/
public final class RuntimeConfig
{
/**
* Number of runtime threads to spawn. For a guess of the number of CPU cores, use 0.
*
* Even if tons of connections are expected, it is preferred to use a value around the number of CPU cores for better performances. The library uses an efficient thread pool polling mechanism.
*/
public UShort numCoreThreads;
/**
* @param value New value for the 'numCoreThreads' field
* @return Reference to this instance of the class with the modified value
*/
public RuntimeConfig withNumCoreThreads(UShort value)
{
this.numCoreThreads = value;
return this;
}
/**
* Initialize the configuration to default values
*
* Values are initialized to:
*
* - {@link RuntimeConfig#numCoreThreads} : 0
*
*
*/
public RuntimeConfig()
{
this.numCoreThreads = UShort.valueOf(0);
}
private RuntimeConfig(UShort numCoreThreads)
{
this.numCoreThreads = numCoreThreads;
}
void _assertFieldsNotNull()
{
java.util.Objects.requireNonNull(numCoreThreads, "numCoreThreads cannot be null");
}
}