public class Server
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
STATIC_CONTENT_ROOT
Path to static content to be served by created Server instance.
|
Constructor and Description |
---|
Server(java.lang.Class<?>... configuration)
Create new server instance.
|
Server(java.util.Map<java.lang.String,java.lang.Object> properties,
java.lang.Class<?>... configuration)
Create new server instance.
|
Server(java.lang.String hostName,
int port,
java.lang.String contextPath,
java.util.Map<java.lang.String,java.lang.Object> properties,
java.lang.Class<?>... configuration)
Construct new server.
|
Server(java.lang.String hostName,
int port,
java.lang.String contextPath,
java.util.Map<java.lang.String,java.lang.Object> properties,
java.util.Set<java.lang.Class<?>> configuration)
Construct new server.
|
Modifier and Type | Method and Description |
---|---|
int |
getPort()
Get the port which was used to start the container.
|
static void |
main(java.lang.String[] args) |
void |
start()
Start the server.
|
void |
stop()
Stop the server.
|
public static final java.lang.String STATIC_CONTENT_ROOT
Value have to be non-empty String
and should represent content root of static content (file system
path).
public Server(java.lang.Class<?>... configuration)
configuration
- to be registered with the server. Classes annotated with ServerEndpoint
, implementing
ServerApplicationConfig
or extending ServerEndpointConfig
are supported.public Server(java.util.Map<java.lang.String,java.lang.Object> properties, java.lang.Class<?>... configuration)
properties
- properties used as a parameter to (java.util.Map)
call.configuration
- to be registered with the server. Classes annotated with ServerEndpoint
, implementing ServerApplicationConfig
or extending ServerEndpointConfig
are supported.public Server(java.lang.String hostName, int port, java.lang.String contextPath, java.util.Map<java.lang.String,java.lang.Object> properties, java.lang.Class<?>... configuration)
hostName
- hostName of the server.port
- port of the server. When provided value is 0
, default port ()
will be used, when -1
, ephemeral port number will be used.contextPath
- root path to the server App.properties
- properties used as a parameter to (java.util.Map)
call.configuration
- to be registered with the server. Classes annotated with ServerEndpoint
, implementing
ServerApplicationConfig
or extending ServerEndpointConfig
are supported.getPort()
public Server(java.lang.String hostName, int port, java.lang.String contextPath, java.util.Map<java.lang.String,java.lang.Object> properties, java.util.Set<java.lang.Class<?>> configuration)
hostName
- hostName of the server.port
- port of the server. When provided value is 0
, default port ()
will be used, when -1
, ephemeral port number will be used.contextPath
- root path to the server App.properties
- properties used as a parameter to (java.util.Map)
call.configuration
- to be registered with the server. Classes annotated with ServerEndpoint
, implementing ServerApplicationConfig
or extending ServerEndpointConfig
are supported.getPort()
public static void main(java.lang.String[] args)
public void start() throws DeploymentException
DeploymentException
public int getPort()
public void stop()
Copyright © 2012–2020 Oracle Corporation. All rights reserved.