public class Server
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Server.Builder
Configures and builds an embedded server.
|
static class |
Server.Protocol
Specifies the protocols supported by the server.
|
Constructor and Description |
---|
Server(play.core.server.Server server) |
Modifier and Type | Method and Description |
---|---|
static Server |
forRouter(Router router)
Create a server for the given router.
|
static Server |
forRouter(Router router,
int port)
Create a server for the given router.
|
static Server |
forRouter(Router router,
Mode mode)
Create a server for the given router.
|
static Server |
forRouter(Router router,
Mode mode,
int port)
Create a server for the given router.
|
int |
httpPort()
Get the HTTP port the server is running on.
|
int |
httpsPort()
Get the HTTPS port the server is running on.
|
java.net.InetSocketAddress |
mainAddress()
Get the address the server is running on.
|
void |
stop()
Stop the server.
|
public void stop()
public int httpPort()
public int httpsPort()
public java.net.InetSocketAddress mainAddress()
public static Server forRouter(Router router)
The server will be running on a randomly selected ephemeral port, which can be checked using the httpPort property.
The server will be running in TEST mode.
router
- The router for the server to serve.public static Server forRouter(Router router, Mode mode)
The server will be running on a randomly selected ephemeral port, which can be checked using the httpPort property.
router
- The router for the server to serve.mode
- The mode the server will run on.public static Server forRouter(Router router, int port)
The server will be running in TEST mode.
router
- The router for the server to serve.port
- The port the server will run on.