- All Known Implementing Classes:
ServerImpl
public interface Server
Microprofile server.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Server.Builder
builder()
Builder to customize Server instance.static Server
create()
Create a server instance for discovered JAX-RS application (through CDI).static Server
create
(Application... applications) Create a server instance for a JAX-RS application.static Server
create
(Class<? extends Application>... applicationClasses) Create a server instance for a JAX-RS application class.host()
Get the host this server listens on.int
port()
Get the port this server listens on or-1
if the server is not running.start()
Start this server (can only be used once).stop()
Stop this server immediately (can only be used on a started server).
-
Method Details
-
create
Create a server instance for a JAX-RS application.- Parameters:
applications
- application(s) to use- Returns:
- Server instance to be started
- See Also:
-
create
Create a server instance for a JAX-RS application class.- Parameters:
applicationClasses
- application class(es) to use- Returns:
- Server instance to be started
- See Also:
-
create
Create a server instance for discovered JAX-RS application (through CDI).- Returns:
- Server instance to be started
- See Also:
-
builder
Builder to customize Server instance.- Returns:
- builder instance
-
start
Server start()Start this server (can only be used once). This is a blocking call.- Returns:
- Server instance, started
-
stop
Server stop()Stop this server immediately (can only be used on a started server). This is a blocking call.- Returns:
- Server instance, stopped
-
host
String host()Get the host this server listens on.- Returns:
- host name
-
port
int port()Get the port this server listens on or-1
if the server is not running.- Returns:
- port
-