01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.apache.harmony.nio.internal;
19:
20: import java.io.IOException;
21: import java.nio.channels.DatagramChannel;
22: import java.nio.channels.Pipe;
23: import java.nio.channels.ServerSocketChannel;
24: import java.nio.channels.SocketChannel;
25: import java.nio.channels.spi.AbstractSelector;
26: import java.nio.channels.spi.SelectorProvider;
27:
28: /*
29: * Internal implementation of SelectorProvider.
30: */
31: public class EpollSelectorProviderImpl extends SelectorProvider {
32:
33: /*
34: * Constructor for this class.
35: */
36: public EpollSelectorProviderImpl() {
37: super ();
38: System.out.println("Now using EpollSelectorProvider");
39: }
40:
41: /*
42: *
43: * @see java.nio.channels.spi.SelectorProvider#openDatagramChannel()
44: */
45: public DatagramChannel openDatagramChannel() throws IOException {
46: return new DatagramChannelImpl(this );
47: }
48:
49: /*
50: *
51: * @see java.nio.channels.spi.SelectorProvider#openPipe()
52: */
53: public Pipe openPipe() throws IOException {
54: return new PipeImpl();
55: }
56:
57: /*
58: *
59: * @see java.nio.channels.spi.SelectorProvider#openSelector()
60: */
61: public AbstractSelector openSelector() throws IOException {
62: return new EpollSelectorImpl(this );
63: }
64:
65: /*
66: *
67: * @see java.nio.channels.spi.SelectorProvider#openServerSocketChannel()
68: */
69: public ServerSocketChannel openServerSocketChannel()
70: throws IOException {
71: return new ServerSocketChannelImpl(this );
72: }
73:
74: /*
75: *
76: * @see java.nio.channels.spi.SelectorProvider#openSocketChannel()
77: */
78: public SocketChannel openSocketChannel() throws IOException {
79: return new SocketChannelImpl(this);
80: }
81:
82: }
|