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 Detail

      • config

        Config config()
        The Microprofile config instance used to configure this server.
        config instance
      • helidonConfig

        Config helidonConfig()
        The Helidon config instance used to configure this server (will have same properties as config()).
        Helidon config instance
      • applications

        List<ResourceConfig> applications()
        Access existing applications configured with the server.
        list of all applications
      • addApplication

        void addApplication​(String contextRoot,
                            Application application)
        Add a jersey application to the server with an explicit context path.
        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).
        The CDI container
      • serverConfigBuilder

        ServerConfiguration.Builder serverConfigBuilder()
        Helidon web server configuration builder that can be used to re-configure the web server.
        web server configuration builder
      • serverRoutingBuilder

        Routing.Builder serverRoutingBuilder()
        Helidon webserver routing builder that can be used to add routes to the webserver.
        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.
        name - name of the named routing (should match a named socket configuration)
        builder for routing of the named route
      • register

        <U> void register​(Class<? extends U> key,
                          U instance)
        Register 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
        key - class to register
        instance - instance of a class
      • register

        void register​(Object classifier,
                      Object instance)
        Register an instance for later use. This instance will be accessible from Config.Context throughout the application.
        classifier - an additional registered instance classifier
        instance - instance to register
        See Also:
        Context.register(Object, Object)