Interface MpServiceContext
-
public interface MpServiceContext
A context to allow a microprofile server extension to configure additional resources with Jersey, web server or use the CDI container (already booted).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addApplication(String contextRoot, Application application)
Add a jersey application to the server with an explicit context path.void
addApplication(Application application)
Add a jersey application to the server.List<ResourceConfig>
applications()
Access existing applications configured with the server.SeContainer
cdiContainer()
The CDI container used by this server (Weld SE container).Config
config()
The Microprofile config instance used to configure this server.Config
helidonConfig()
The Helidon config instance used to configure this server (will have same properties asconfig()
).<U> void
register(Class<? extends U> key, U instance)
Deprecated.useregister(Object)
orregister(Object, Object)
insteadvoid
register(Object instance)
Register an instance for later use.void
register(Object classifier, Object instance)
Register an instance for later use.ServerConfiguration.Builder
serverConfigBuilder()
Helidon web server configuration builder that can be used to re-configure the web server.Routing.Builder
serverNamedRoutingBuilder(String name)
Helidon webserver routing builder that can be used to add routes to a named socket of the webserver.Routing.Builder
serverRoutingBuilder()
Helidon webserver routing builder that can be used to add routes to the webserver.
-
-
-
Method Detail
-
config
Config config()
The Microprofile config instance used to configure this server.- Returns:
- config instance
-
helidonConfig
Config helidonConfig()
The Helidon config instance used to configure this server (will have same properties asconfig()
).- Returns:
- Helidon config instance
-
applications
List<ResourceConfig> applications()
Access existing applications configured with the server.- Returns:
- list of all applications
-
addApplication
void addApplication(Application application)
Add a jersey application to the server. Context will be introspected fromApplicationPath
annotation. You can also useaddApplication(String, Application)
.- Parameters:
application
- configured as needed
-
addApplication
void addApplication(String contextRoot, Application application)
Add a jersey application to the server with an explicit context path.- Parameters:
contextRoot
- Context root to use for this application (ApplicationPath
is ignored)application
- configured as needed
-
cdiContainer
SeContainer cdiContainer()
The CDI container used by this server (Weld SE container).- Returns:
- The CDI container
-
serverConfigBuilder
ServerConfiguration.Builder serverConfigBuilder()
Helidon web server configuration builder that can be used to re-configure the web server.- Returns:
- web server configuration builder
-
serverRoutingBuilder
Routing.Builder serverRoutingBuilder()
Helidon webserver routing builder that can be used to add routes to the webserver.- Returns:
- server routing builder
-
serverNamedRoutingBuilder
Routing.Builder serverNamedRoutingBuilder(String name)
Helidon webserver routing builder that can be used to add routes to a named socket of the webserver.- Parameters:
name
- name of the named routing (should match a named socket configuration)- Returns:
- builder for routing of the named route
-
register
@Deprecated <U> void register(Class<? extends U> key, U instance)
Deprecated.useregister(Object)
orregister(Object, Object)
insteadRegister an instance of a class for later use (e.g. for outbound configuration). This will replace existing instance of the class if it is already configured.- Type Parameters:
U
- type of the instance- Parameters:
key
- class to registerinstance
- instance of a class
-
register
void register(Object instance)
Register an instance for later use. This instance will be accessible fromConfig.Context
throughout the application.- Parameters:
instance
- instance to register- See Also:
Context.register(Object, Object)
-
register
void register(Object classifier, Object instance)
Register an instance for later use. This instance will be accessible fromConfig.Context
throughout the application.- Parameters:
classifier
- an additional registered instance classifierinstance
- instance to register- See Also:
Context.register(Object, Object)
-
-