Interface MpServiceContext
-
public interface MpServiceContextA 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 voidaddApplication(String contextRoot, Application application)Add a jersey application to the server with an explicit context path.voidaddApplication(Application application)Add a jersey application to the server.List<org.glassfish.jersey.server.ResourceConfig>applications()Access existing applications configured with the server.SeContainercdiContainer()The CDI container used by this server (Weld SE container).org.eclipse.microprofile.config.Configconfig()The Microprofile config instance used to configure this server.ConfighelidonConfig()The Helidon config instance used to configure this server (will have same properties asconfig()).<U> voidregister(Class<? extends U> key, U instance)Deprecated.useregister(Object)orregister(Object, Object)insteadvoidregister(Object instance)Register an instance for later use.voidregister(Object classifier, Object instance)Register an instance for later use.ServerConfiguration.BuilderserverConfigBuilder()Helidon web server configuration builder that can be used to re-configure the web server.Routing.BuilderserverNamedRoutingBuilder(String name)Helidon webserver routing builder that can be used to add routes to a named socket of the webserver.Routing.BuilderserverRoutingBuilder()Helidon webserver routing builder that can be used to add routes to the webserver.
-
-
-
Method Detail
-
config
org.eclipse.microprofile.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<org.glassfish.jersey.server.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 fromApplicationPathannotation. 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 (ApplicationPathis 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.Contextthroughout 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.Contextthroughout the application.- Parameters:
classifier- an additional registered instance classifierinstance- instance to register- See Also:
Context.register(Object, Object)
-
-