当前位置: 首页>>代码示例>>Java>>正文


Java EmptyArrays.EMPTY_OBJECTS属性代码示例

本文整理汇总了Java中io.netty.util.internal.EmptyArrays.EMPTY_OBJECTS属性的典型用法代码示例。如果您正苦于以下问题:Java EmptyArrays.EMPTY_OBJECTS属性的具体用法?Java EmptyArrays.EMPTY_OBJECTS怎么用?Java EmptyArrays.EMPTY_OBJECTS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在io.netty.util.internal.EmptyArrays的用法示例。


在下文中一共展示了EmptyArrays.EMPTY_OBJECTS属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ThreadPerChannelEventLoopGroup

/**
 * Create a new {@link ThreadPerChannelEventLoopGroup}.
 *
 * @param maxChannels       the maximum number of channels to handle with this instance. Once you try to register
 *                          a new {@link Channel} and the maximum is exceed it will throw an
 *                          {@link ChannelException} on the {@link #register(Channel)} and
 *                          {@link #register(Channel, ChannelPromise)} method.
 *                          Use {@code 0} to use no limit
 * @param threadFactory     the {@link ThreadFactory} used to create new {@link Thread} instances that handle the
 *                          registered {@link Channel}s
 * @param args              arguments which will passed to each {@link #newChild(Object...)} call.
 */
protected ThreadPerChannelEventLoopGroup(int maxChannels, ThreadFactory threadFactory, Object... args) {
    if (maxChannels < 0) {
        throw new IllegalArgumentException(String.format(
                "maxChannels: %d (expected: >= 0)", maxChannels));
    }
    if (threadFactory == null) {
        throw new NullPointerException("threadFactory");
    }

    if (args == null) {
        childArgs = EmptyArrays.EMPTY_OBJECTS;
    } else {
        childArgs = args.clone();
    }

    this.maxChannels = maxChannels;
    this.threadFactory = threadFactory;

    tooManyChannels = new ChannelException("too many channels (max: " + maxChannels + ')');
    tooManyChannels.setStackTrace(EmptyArrays.EMPTY_STACK_TRACE);
}
 
开发者ID:wuyinxian124,项目名称:netty4.0.27Learn,代码行数:33,代码来源:ThreadPerChannelEventLoopGroup.java

示例2: ThreadPerChannelEventLoopGroup

/**
 * Create a new {@link ThreadPerChannelEventLoopGroup}.
 *
 * @param maxChannels       the maximum number of channels to handle with this instance. Once you try to register
 *                          a new {@link Channel} and the maximum is exceed it will throw an
 *                          {@link ChannelException}. Use {@code 0} to use no limit
 * @param executor          the {@link Executor} used to create new {@link Thread} instances that handle the
 *                          registered {@link Channel}s
 * @param args              arguments which will passed to each {@link #newChild(Object...)} call.
 */
protected ThreadPerChannelEventLoopGroup(int maxChannels, Executor executor, Object... args) {
    if (maxChannels < 0) {
        throw new IllegalArgumentException(String.format(
                "maxChannels: %d (expected: >= 0)", maxChannels));
    }
    if (executor == null) {
        throw new NullPointerException("executor");
    }

    if (args == null) {
        childArgs = EmptyArrays.EMPTY_OBJECTS;
    } else {
        childArgs = args.clone();
    }

    this.maxChannels = maxChannels;
    this.executor = executor;

    tooManyChannels = new ChannelException("too many channels (max: " + maxChannels + ')');
    tooManyChannels.setStackTrace(EmptyArrays.EMPTY_STACK_TRACE);
}
 
开发者ID:nathanchen,项目名称:netty-netty-5.0.0.Alpha1,代码行数:31,代码来源:ThreadPerChannelEventLoopGroup.java


注:本文中的io.netty.util.internal.EmptyArrays.EMPTY_OBJECTS属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。