org.zodiac.sdk.simplenetty.channel.ChannelConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zodiac-sdk-nio Show documentation
Show all versions of zodiac-sdk-nio Show documentation
Zodiac SDK NIO2(New Non-Blocking IO)
package org.zodiac.sdk.simplenetty.channel;
import java.util.*;
public class ChannelConfig {
private static Map parentOptions;
private static Map childOptions;
static {
parentOptions = new HashMap<>();
childOptions = new HashMap<>();
parentOptions.put(ChannelOption.CORE_SIZE.name, 2);
childOptions.put(ChannelOption.CORE_SIZE.name, ChannelOption.CORE_SIZE.value);
}
public static T getParentOption(String name, Class tClass) {
return (T)parentOptions.get(name);
}
public static T getChildOption(String name, Class tClass) {
return (T)childOptions.get(name);
}
public static void addParentOption(ChannelOption option) {
parentOptions.put(option.name, option.value);
}
public static void addChildOption(ChannelOption option) {
childOptions.put(option.name, option.value);
}
}