Package io.helidon.microprofile.server
Interface Server
-
- All Known Implementing Classes:
ServerImpl
public interface Server
Microprofile server.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Server.Builder
Builder to buildServer
instance.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static Server.Builder
builder()
Builder to customize Server instance.SeContainer
cdiContainer()
Get CDI container in use.static Server
create()
Create a server instance for discovered JAX-RS application (through CDI).static Server
create(Class<? extends Application>... applicationClasses)
Create a server instance for a JAX-RS application class.static Server
create(Application... applications)
Create a server instance for a JAX-RS application.String
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.int
port(String socketName)
Get the port of the named socket.Server
start()
Start this server (can only be used once).Server
stop()
Stop this server immediately (can only be used on a started server).
-
-
-
Method Detail
-
create
static Server create(Application... applications) throws MpException
Create a server instance for a JAX-RS application.- Parameters:
applications
- application(s) to use- Returns:
- Server instance to be started
- Throws:
MpException
- in case the server fails to be created- See Also:
builder()
-
create
@SafeVarargs static Server create(Class<? extends Application>... applicationClasses) throws MpException
Create a server instance for a JAX-RS application class.- Parameters:
applicationClasses
- application class(es) to use- Returns:
- Server instance to be started
- Throws:
MpException
- in case the server fails to be created- See Also:
builder()
-
create
static Server create() throws MpException
Create a server instance for discovered JAX-RS application (through CDI).- Returns:
- Server instance to be started
- Throws:
MpException
- in case the server fails to be created- See Also:
builder()
-
builder
static Server.Builder builder()
Builder to customize Server instance.- Returns:
- builder instance
-
cdiContainer
SeContainer cdiContainer()
Get CDI container in use.- Returns:
- CDI container instance (standard edition)
-
start
Server start() throws MpException
Start this server (can only be used once). This is a blocking call.- Returns:
- Server instance, started
- Throws:
MpException
- in case the server fails to start
-
stop
Server stop() throws MpException
Stop this server immediately (can only be used on a started server). This is a blocking call.- Returns:
- Server instance, stopped
- Throws:
MpException
- in case the server fails to stop
-
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
-
port
int port(String socketName)
Get the port of the named socket.- Parameters:
socketName
- name of the socket- Returns:
- port
-
-