com.zusmart.base.network.nio.NioChannelEventLoopGroup Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zusmart-base Show documentation
Show all versions of zusmart-base Show documentation
提供基础的工具类及方法类,Logging,Scanner,Buffer,NetWork,Future,Thread
package com.zusmart.base.network.nio;
import com.zusmart.base.buffer.BufferAllocator;
import com.zusmart.base.looper.support.AbstractThreadEventLoopGroup;
import com.zusmart.base.network.ChannelOption;
public class NioChannelEventLoopGroup extends AbstractThreadEventLoopGroup {
private final ChannelOption channelOption;
private final BufferAllocator bufferAllocator;
public NioChannelEventLoopGroup(ChannelOption channelOption,BufferAllocator bufferAllocator) {
super(channelOption.getNioSelectorSize(), channelOption.getNioSelectorName());
this.channelOption = channelOption;
this.bufferAllocator = bufferAllocator;
}
@Override
protected NioChannelEventLoop createEventLoop(String name) {
return new NioChannelEventLoop(name, this);
}
@Override
public NioChannelEventLoop getEventLoop() {
return (NioChannelEventLoop) super.getEventLoop();
}
@Override
public NioChannelEventLoop getEventLoop(int index) {
return (NioChannelEventLoop) super.getEventLoop(index);
}
public ChannelOption getChannelOption() {
return this.channelOption;
}
public BufferAllocator getBufferAllocator() {
return this.bufferAllocator;
}
}