2
|
1 |
/*
|
5506
|
2 |
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
|
2
|
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
|
5506
|
7 |
* published by the Free Software Foundation. Oracle designates this
|
2
|
8 |
* particular file as subject to the "Classpath" exception as provided
|
5506
|
9 |
* by Oracle in the LICENSE file that accompanied this code.
|
2
|
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 |
*
|
5506
|
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.
|
2
|
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 HttpsServerImpl extends HttpsServer {
|
|
40 |
|
|
41 |
ServerImpl server;
|
|
42 |
|
|
43 |
HttpsServerImpl () throws IOException {
|
|
44 |
this (new InetSocketAddress(443), 0);
|
|
45 |
}
|
|
46 |
|
|
47 |
HttpsServerImpl (
|
|
48 |
InetSocketAddress addr, int backlog
|
|
49 |
) throws IOException {
|
|
50 |
server = new ServerImpl (this, "https", addr, backlog);
|
|
51 |
}
|
|
52 |
|
|
53 |
public void setHttpsConfigurator (HttpsConfigurator config) {
|
|
54 |
server.setHttpsConfigurator (config);
|
|
55 |
}
|
|
56 |
|
|
57 |
public HttpsConfigurator getHttpsConfigurator () {
|
|
58 |
return server.getHttpsConfigurator();
|
|
59 |
}
|
|
60 |
|
|
61 |
public void bind (InetSocketAddress addr, int backlog) throws IOException {
|
|
62 |
server.bind (addr, backlog);
|
|
63 |
}
|
|
64 |
|
|
65 |
public void start () {
|
|
66 |
server.start();
|
|
67 |
}
|
|
68 |
|
|
69 |
public void setExecutor (Executor executor) {
|
|
70 |
server.setExecutor(executor);
|
|
71 |
}
|
|
72 |
|
|
73 |
public Executor getExecutor () {
|
|
74 |
return server.getExecutor();
|
|
75 |
}
|
|
76 |
|
|
77 |
public void stop (int delay) {
|
|
78 |
server.stop (delay);
|
|
79 |
}
|
|
80 |
|
|
81 |
public HttpContextImpl createContext (String path, HttpHandler handler) {
|
|
82 |
return server.createContext (path, handler);
|
|
83 |
}
|
|
84 |
|
|
85 |
public HttpContextImpl createContext (String path) {
|
|
86 |
return server.createContext (path);
|
|
87 |
}
|
|
88 |
|
|
89 |
public void removeContext (String path) throws IllegalArgumentException {
|
|
90 |
server.removeContext (path);
|
|
91 |
}
|
|
92 |
|
|
93 |
public void removeContext (HttpContext context) throws IllegalArgumentException {
|
|
94 |
server.removeContext (context);
|
|
95 |
}
|
|
96 |
|
|
97 |
public InetSocketAddress getAddress() {
|
|
98 |
return server.getAddress();
|
|
99 |
}
|
|
100 |
}
|