LocalChannelRegistry Class — netty Architecture
Architecture documentation for the LocalChannelRegistry class in LocalChannelRegistry.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD f027f74b_7581_0b0b_c41d_d4163f747680["LocalChannelRegistry"] 640251a7_cf38_40d6_db66_d66f3a7ac8c1["LocalChannelRegistry.java"] f027f74b_7581_0b0b_c41d_d4163f747680 -->|defined in| 640251a7_cf38_40d6_db66_d66f3a7ac8c1 72ef2984_028e_1097_3333_167d4629cb95["LocalAddress()"] f027f74b_7581_0b0b_c41d_d4163f747680 -->|method| 72ef2984_028e_1097_3333_167d4629cb95 a3dec81d_9506_af26_0420_7f0ff55f0413["Channel()"] f027f74b_7581_0b0b_c41d_d4163f747680 -->|method| a3dec81d_9506_af26_0420_7f0ff55f0413 8ca090be_f95c_f2ac_5da3_409209ef4824["unregister()"] f027f74b_7581_0b0b_c41d_d4163f747680 -->|method| 8ca090be_f95c_f2ac_5da3_409209ef4824 eba46c11_6133_2d08_aaba_88bc99897db3["LocalChannelRegistry()"] f027f74b_7581_0b0b_c41d_d4163f747680 -->|method| eba46c11_6133_2d08_aaba_88bc99897db3
Relationship Graph
Source Code
transport/src/main/java/io/netty/channel/local/LocalChannelRegistry.java lines 26–62
final class LocalChannelRegistry {
private static final ConcurrentMap<LocalAddress, Channel> boundChannels = new ConcurrentHashMap<>();
static LocalAddress register(
Channel channel, LocalAddress oldLocalAddress, SocketAddress localAddress) {
if (oldLocalAddress != null) {
throw new ChannelException("already bound");
}
if (!(localAddress instanceof LocalAddress)) {
throw new ChannelException("unsupported address type: " + StringUtil.simpleClassName(localAddress));
}
LocalAddress addr = (LocalAddress) localAddress;
if (LocalAddress.ANY.equals(addr)) {
addr = new LocalAddress(channel);
}
Channel boundChannel = boundChannels.putIfAbsent(addr, channel);
if (boundChannel != null) {
throw new ChannelException("address already in use by: " + boundChannel);
}
return addr;
}
static Channel get(SocketAddress localAddress) {
return boundChannels.get(localAddress);
}
static void unregister(LocalAddress localAddress) {
boundChannels.remove(localAddress);
}
private LocalChannelRegistry() {
// Unused
}
}
Source
Frequently Asked Questions
What is the LocalChannelRegistry class?
LocalChannelRegistry is a class in the netty codebase, defined in transport/src/main/java/io/netty/channel/local/LocalChannelRegistry.java.
Where is LocalChannelRegistry defined?
LocalChannelRegistry is defined in transport/src/main/java/io/netty/channel/local/LocalChannelRegistry.java at line 26.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free