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.
        Returns:
        config instance
      • helidonConfig

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

        List<ResourceConfig> applications()
        Access existing applications configured with the server.
        Returns:
        list of all applications
      • 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.
        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
        Parameters:
        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.
        Parameters:
        classifier - an additional registered instance classifier
        instance - instance to register
        See Also:
        Context.register(Object, Object)