History

My first initial commit with all of mine experimental changes.

Dmitry Kabak (userdima committed 13 years ago

Commit d37b88d1 parent 3f5b46618352 files · +2598093 −-8690Browse files

Showing the changes to java/pkg/sun/net/httpserver/HttpServerImpl.java (1 of 18352 files). Show all

Unified · Split

java/pkg/sun/net/httpserver/HttpServerImpl.java+92−0
@@ -0,0 +1,92 @@
1+/*
2+ * Copyright (c) 2005, Oracle and/or its affiliates. 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. Oracle designates this
8+ * particular file as subject to the "Classpath" exception as provided
9+ * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+ * or visit www.oracle.com if you need additional information or have any
23+ * questions.
24+ */
25+
26+package sun.net.httpserver;
27+
28+import java.net.*;
29+import java.io.*;
30+import java.nio.*;
31+import java.security.*;
32+import java.nio.channels.*;
33+import java.util.*;
34+import java.util.concurrent.*;
35+import javax.net.ssl.*;
36+import com.sun.net.httpserver.*;
37+import com.sun.net.httpserver.spi.*;
38+
39+public 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+}