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 SelectorProviderImpl extends SelectorProvider {
32:
33: /*
34: * Constructor for this class.
35: */
36: public SelectorProviderImpl() {
37: super ();
38: }
39:
40: /**
41: * @see java.nio.channels.spi.SelectorProvider#openDatagramChannel()
42: */
43: public DatagramChannel openDatagramChannel() throws IOException {
44: return new DatagramChannelImpl(this );
45: }
46:
47: /**
48: * @see java.nio.channels.spi.SelectorProvider#openPipe()
49: */
50: public Pipe openPipe() throws IOException {
51: return new PipeImpl();
52: }
53:
54: /**
55: * @see java.nio.channels.spi.SelectorProvider#openSelector()
56: */
57: public AbstractSelector openSelector() throws IOException {
58: return new SelectorImpl(this );
59: }
60:
61: /**
62: * @see java.nio.channels.spi.SelectorProvider#openServerSocketChannel()
63: */
64: public ServerSocketChannel openServerSocketChannel()
65: throws IOException {
66: return new ServerSocketChannelImpl(this );
67: }
68:
69: /**
70: * @see java.nio.channels.spi.SelectorProvider#openSocketChannel()
71: */
72: public SocketChannel openSocketChannel() throws IOException {
73: return new SocketChannelImpl(this);
74: }
75: }
|