Package ratpack.impose
Class ForceServerListenPortImposition
- java.lang.Object
-
- ratpack.impose.ForceServerListenPortImposition
-
- All Implemented Interfaces:
Imposition
public final class ForceServerListenPortImposition extends java.lang.Object implements Imposition
Forces the port that the server should use to listen for requests.This imposition is used by
ServerConfigBuilder
. If present, the imposed value will be used regardless of any previously specified setting on the builder.- Since:
- 1.2
- See Also:
ServerConfigBuilder.port(int)
,Impositions
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ForceServerListenPortImposition
ephemeral()
Creates an imposition that forces the use of an ephemeral port.int
getPort()
The port to be forced.static ForceServerListenPortImposition
of(int port)
Creates an imposition that forces the use of the specified port.
-
-
-
Method Detail
-
ephemeral
public static ForceServerListenPortImposition ephemeral()
Creates an imposition that forces the use of an ephemeral port.- Returns:
- an imposition for an ephemeral port
-
of
public static ForceServerListenPortImposition of(int port)
Creates an imposition that forces the use of the specified port.- Parameters:
port
- the port to force- Returns:
- an imposition for the specified port
-
getPort
public int getPort()
The port to be forced.- Returns:
- the port to be forced
-
-