blob: 82f56a72689fab517ab0f52c1398183be992bdbb [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001/*
2 * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Sun designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Sun in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25
26package sun.net.httpserver;
27
28import java.net.*;
29import java.io.*;
30import java.nio.*;
31import java.security.*;
32import java.nio.channels.*;
33import java.util.*;
34import java.util.concurrent.*;
35import javax.net.ssl.*;
36import com.sun.net.httpserver.*;
37import com.sun.net.httpserver.spi.*;
38
39public class HttpServerImpl extends HttpServer {
40
41 ServerImpl server;
42
43 HttpServerImpl () throws IOException {
44 this (new InetSocketAddress(80), 0);
45 }
46
47 HttpServerImpl (
48 InetSocketAddress addr, int backlog
49 ) throws IOException {
50 server = new ServerImpl (this, "http", addr, backlog);
51 }
52
53 public void bind (InetSocketAddress addr, int backlog) throws IOException {
54 server.bind (addr, backlog);
55 }
56
57 public void start () {
58 server.start();
59 }
60
61 public void setExecutor (Executor executor) {
62 server.setExecutor(executor);
63 }
64
65 public Executor getExecutor () {
66 return server.getExecutor();
67 }
68
69 public void stop (int delay) {
70 server.stop (delay);
71 }
72
73 public HttpContextImpl createContext (String path, HttpHandler handler) {
74 return server.createContext (path, handler);
75 }
76
77 public HttpContextImpl createContext (String path) {
78 return server.createContext (path);
79 }
80
81 public void removeContext (String path) throws IllegalArgumentException {
82 server.removeContext (path);
83 }
84
85 public void removeContext (HttpContext context) throws IllegalArgumentException {
86 server.removeContext (context);
87 }
88
89 public InetSocketAddress getAddress() {
90 return server.getAddress();
91 }
92}