All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.zusmart.base.network.nio.NioChannelEventLoopGroup Maven / Gradle / Ivy

Go to download

提供基础的工具类及方法类,Logging,Scanner,Buffer,NetWork,Future,Thread

There is a newer version: 1.0.6
Show newest version
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;
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy