APIdia Launch Partner
Top Description Fields Constructors Methods
sun.net.httpserver.simpleserver

public Class JWebServer

extends Object
Class Inheritance
Imports
java.io.PrintWriter

Programmatic entry point to start the jwebserver tool.

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
public static final String
public static final String
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
private
JWebServer()

This constructor should never be called.

Method Summary

Modifier and TypeMethod and Description
public static void
main(String...
the command-line options
args
)

The main entry point.

pack-priv static void
pack-priv static void
private static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_ENHANCED_EXCEPback to summary
private static final String DEFAULT_ENHANCED_EXCEP
DEFAULT_JWEBSERVER_MAX_CONNECTIONSback to summary
private static final String DEFAULT_JWEBSERVER_MAX_CONNECTIONS
MAXREQTIME_KEYback to summary
public static final String MAXREQTIME_KEY
MAXREQTIME_VALback to summary
public static final String MAXREQTIME_VAL
SYS_PROP_ENHANCED_EXCEPback to summary
private static final String SYS_PROP_ENHANCED_EXCEP
SYS_PROP_MAX_CONNECTIONSback to summary
private static final String SYS_PROP_MAX_CONNECTIONS

Constructor Detail

JWebServerback to summary
private JWebServer()

This constructor should never be called.

Method Detail

mainback to summary
public static void main(String... args)

The main entry point.

The command line arguments are parsed and the server is started. If started successfully, the server will run on a new non-daemon thread, and this method will return. Otherwise, if the server is not started successfully, e.g. an error is encountered while parsing the arguments or an I/O error occurs, the server is not started and this method invokes System::exit with an appropriate exit code.

If the system property "sun.net.httpserver.maxReqTime" has not been set by the user, it is set to a value of 5 seconds. This is to prevent the server from hanging indefinitely, for example in the case of an HTTPS request.

Parameters
args:String[]

the command-line options

Exceptions
NullPointerException:
if args is null, or if there are any null values in the args array
setEnhancedExceptionsback to summary
pack-priv static void setEnhancedExceptions()
setMaxConnectionsIfNotSetback to summary
pack-priv static void setMaxConnectionsIfNotSet()
setMaxReqTimeback to summary
private static void setMaxReqTime()