Netty-基础类介绍

归档


类继承关系


事件轮循

NioEventLoopGroup
  • 相当于线程池
// io.netty.channel.nio.NioEventLoopGroup
public class NioEventLoopGroup extends MultithreadEventLoopGroup {
}
// io.netty.channel.MultithreadEventLoopGroup
//   sign_c_010 EventLoopGroup
public abstract class MultithreadEventLoopGroup extends MultithreadEventExecutorGroup implements EventLoopGroup {
}
// io.netty.util.concurrent.MultithreadEventExecutorGroup
public abstract class MultithreadEventExecutorGroup extends AbstractEventExecutorGroup {
}
// io.netty.util.concurrent.AbstractEventExecutorGroup
public abstract class AbstractEventExecutorGroup implements EventExecutorGroup {
}

// -------------- 接口 --------------

// sign_c_001 io.netty.util.concurrent.EventExecutorGroup
public interface EventExecutorGroup extends ScheduledExecutorService, Iterable<EventExecutor> {
}

// -------------- JDK 接口 --------------

// java.util.concurrent.ScheduledExecutorService
public interface ScheduledExecutorService extends ExecutorService {
}
// java.util.concurrent.ExecutorService
public interface ExecutorService extends Executor {
}
// java.util.concurrent.Executor
public interface Executor {
}
NioEventLoop
  • 相当于线程
// io.netty.channel.nio.NioEventLoop
public final class NioEventLoop extends SingleThreadEventLoop {
}
// io.netty.channel.SingleThreadEventLoop
public abstract class SingleThreadEventLoop extends SingleThreadEventExecutor implements EventLoop {
}
// io.netty.util.concurrent.SingleThreadEventExecutor
// io.netty.util.concurrent.OrderedEventExecutor
public abstract class SingleThreadEventExecutor extends AbstractScheduledEventExecutor implements OrderedEventExecutor {
}
// io.netty.util.concurrent.AbstractScheduledEventExecutor
public abstract class AbstractScheduledEventExecutor extends AbstractEventExecutor {
}
// io.netty.util.concurrent.AbstractEventExecutor
// java.util.concurrent.AbstractExecutorService // JUC 工具类,不能当作线程池,只能算是(单线程)执行者
public abstract class AbstractEventExecutor extends AbstractExecutorService implements EventExecutor {
}

// -------------- 接口 --------------

// io.netty.channel.EventLoop
public interface EventLoop extends OrderedEventExecutor, EventLoopGroup {
}
// io.netty.util.concurrent.OrderedEventExecutor
public interface OrderedEventExecutor extends EventExecutor {
}
// sign_c_010 io.netty.channel.EventLoopGroup
public interface EventLoopGroup extends EventExecutorGroup {    // sign_c_001 EventExecutorGroup
}
// io.netty.util.concurrent.EventExecutor
public interface EventExecutor extends EventExecutorGroup {     // sign_c_001 EventExecutorGroup
}

信道

NioServerSocketChannel
  • 相当于 JDK java.nio.channels.ServerSocketChannel
// io.netty.channel.socket.nio.NioServerSocketChannel
public class NioServerSocketChannel extends AbstractNioMessageChannel
                                    implements io.netty.channel.socket.ServerSocketChannel {
}
// io.netty.channel.nio.AbstractNioMessageChannel
public abstract class AbstractNioMessageChannel extends AbstractNioChannel {
}
// io.netty.channel.nio.AbstractNioChannel
public abstract class AbstractNioChannel extends AbstractChannel {
}
// io.netty.channel.AbstractChannel
public abstract class AbstractChannel extends DefaultAttributeMap implements Channel {
}
// io.netty.util.DefaultAttributeMap
public class DefaultAttributeMap implements AttributeMap {
}

// -------------- 接口 --------------

// sign_c_011 io.netty.channel.Channel
public interface Channel extends AttributeMap, ChannelOutboundInvoker, Comparable<Channel> {
}
NioSocketChannel
  • 相当于 JDK java.nio.channels.SocketChannel
// io.netty.channel.socket.nio.NioSocketChannel
public class NioSocketChannel extends AbstractNioByteChannel implements io.netty.channel.socket.SocketChannel {
}
// io.netty.channel.nio.AbstractNioByteChannel
public abstract class AbstractNioByteChannel extends AbstractNioChannel { // AbstractNioChannel 同上
}

// -------------- 接口 --------------

// io.netty.channel.socket.SocketChannel
public interface SocketChannel extends DuplexChannel {
}
// io.netty.channel.socket.DuplexChannel
public interface DuplexChannel extends Channel { // sign_c_011 Channel
}

Unsafa

  • 都是 Channel 实例类
NioMessageUnsafe
// io.netty.channel.nio.AbstractNioMessageChannel.NioMessageUnsafe
private final class NioMessageUnsafe extends AbstractNioUnsafe {
}
// sign_c_021 io.netty.channel.nio.AbstractNioChannel.AbstractNioUnsafe
protected abstract class AbstractNioUnsafe extends AbstractUnsafe implements NioUnsafe {
}
// io.netty.channel.AbstractChannel.AbstractUnsafe
protected abstract class AbstractUnsafe implements Unsafe {
}

// -------------- 接口 --------------
// io.netty.channel.nio.AbstractNioChannel.NioUnsafe
public interface NioUnsafe extends Unsafe {
}
// io.netty.channel.Channel.Unsafe
interface Unsafe {
}
NioSocketChannelUnsafe
// io.netty.channel.socket.nio.NioSocketChannel.NioSocketChannelUnsafe
private final class NioSocketChannelUnsafe extends NioByteUnsafe {
}
// io.netty.channel.nio.AbstractNioByteChannel.NioByteUnsafe
protected class NioByteUnsafe extends AbstractNioUnsafe { // sign_c_021 AbstractNioUnsafe
}

Promise

DefaultChannelPromise
// io.netty.channel.DefaultChannelPromise
// io.netty.channel.ChannelPromise
// io.netty.channel.ChannelFlushPromiseNotifier.FlushCheckpoint
public class DefaultChannelPromise extends DefaultPromise<Void> implements ChannelPromise, FlushCheckpoint {
}
// io.netty.util.concurrent.DefaultPromise
// io.netty.util.concurrent.Promise
public class DefaultPromise<V> extends AbstractFuture<V> implements Promise<V> {
}
// io.netty.util.concurrent.AbstractFuture
public abstract class AbstractFuture<V> implements Future<V> {
}

// -------------- 接口 --------------

// io.netty.util.concurrent.Future
public interface Future<V> extends java.util.concurrent.Future<V> {
}

ByteBuf

PooledUnsafeDirectByteBuf
// io.netty.buffer.PooledUnsafeDirectByteBuf
final class PooledUnsafeDirectByteBuf extends PooledByteBuf<ByteBuffer> {
}
// io.netty.buffer.PooledByteBuf
abstract class PooledByteBuf<T> extends AbstractReferenceCountedByteBuf {
}
// io.netty.buffer.AbstractReferenceCountedByteBuf
public abstract class AbstractReferenceCountedByteBuf extends AbstractByteBuf {
}
// io.netty.buffer.AbstractByteBuf
public abstract class AbstractByteBuf extends ByteBuf {
}
// io.netty.buffer.ByteBuf
//   Comparable: JDK java.lang.Comparable
public abstract class ByteBuf implements ReferenceCounted, Comparable<ByteBuf>, ByteBufConvertible {
}

// -------------- 接口 --------------

// io.netty.util.ReferenceCounted
public interface ReferenceCounted {
}
// io.netty.buffer.ByteBufConvertible
public interface ByteBufConvertible {
}
PooledByteBufAllocator
// io.netty.buffer.PooledByteBufAllocator
public class PooledByteBufAllocator extends AbstractByteBufAllocator implements ByteBufAllocatorMetricProvider {
}
// io.netty.buffer.AbstractByteBufAllocator
public abstract class AbstractByteBufAllocator implements ByteBufAllocator {
}

// -------------- 接口 --------------

// io.netty.buffer.ByteBufAllocatorMetricProvider
public interface ByteBufAllocatorMetricProvider {
}
// io.netty.buffer.ByteBufAllocator
public interface ByteBufAllocator {
}
  • 3
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值