View Javadoc
1   /*
2    * Copyright 2012 The Netty Project
3    *
4    * The Netty Project licenses this file to you under the Apache License,
5    * version 2.0 (the "License"); you may not use this file except in compliance
6    * with the License. You may obtain a copy of the License at:
7    *
8    *   http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations
14   * under the License.
15   */
16  package io.netty.channel.oio;
17  
18  
19  import io.netty.channel.Channel;
20  import io.netty.channel.ChannelException;
21  import io.netty.channel.ChannelPromise;
22  import io.netty.channel.EventLoop;
23  import io.netty.channel.EventLoopGroup;
24  import io.netty.channel.ThreadPerChannelEventLoopGroup;
25  
26  import java.util.concurrent.Executor;
27  import java.util.concurrent.Executors;
28  import java.util.concurrent.ThreadFactory;
29  
30  /**
31   * {@link EventLoopGroup} which is used to handle OIO {@link Channel}'s. Each {@link Channel} will be handled by its
32   * own {@link EventLoop} to not block others.
33   *
34   * @deprecated use NIO / EPOLL / KQUEUE transport.
35   */
36  @Deprecated
37  public class OioEventLoopGroup extends ThreadPerChannelEventLoopGroup {
38  
39      /**
40       * Create a new {@link OioEventLoopGroup} with no limit in place.
41       */
42      public OioEventLoopGroup() {
43          this(0);
44      }
45  
46      /**
47       * Create a new {@link OioEventLoopGroup}.
48       *
49       * @param maxChannels       the maximum number of channels to handle with this instance. Once you try to register
50       *                          a new {@link Channel} and the maximum is exceed it will throw an
51       *                          {@link ChannelException} on the {@link #register(Channel)} and
52       *                          {@link #register(ChannelPromise)} method.
53       *                          Use {@code 0} to use no limit
54       */
55      public OioEventLoopGroup(int maxChannels) {
56          this(maxChannels, Executors.defaultThreadFactory());
57      }
58  
59      /**
60       * Create a new {@link OioEventLoopGroup}.
61       *
62       * @param maxChannels       the maximum number of channels to handle with this instance. Once you try to register
63       *                          a new {@link Channel} and the maximum is exceed it will throw an
64       *                          {@link ChannelException} on the {@link #register(Channel)} and
65       *                          {@link #register(ChannelPromise)} method.
66       *                          Use {@code 0} to use no limit
67       * @param executor     the {@link Executor} used to create new {@link Thread} instances that handle the
68       *                          registered {@link Channel}s
69       */
70      public OioEventLoopGroup(int maxChannels, Executor executor) {
71          super(maxChannels, executor);
72      }
73  
74      /**
75       * Create a new {@link OioEventLoopGroup}.
76       *
77       * @param maxChannels       the maximum number of channels to handle with this instance. Once you try to register
78       *                          a new {@link Channel} and the maximum is exceed it will throw an
79       *                          {@link ChannelException} on the {@link #register(Channel)} and
80       *                          {@link #register(ChannelPromise)} method.
81       *                          Use {@code 0} to use no limit
82       * @param threadFactory     the {@link ThreadFactory} used to create new {@link Thread} instances that handle the
83       *                          registered {@link Channel}s
84       */
85      public OioEventLoopGroup(int maxChannels, ThreadFactory threadFactory) {
86          super(maxChannels, threadFactory);
87      }
88  }