Class HelidonFeatures


  • public final class HelidonFeatures
    extends Object
    Helidon Features support.

    A feature can register using either register(HelidonFlavor, String...) or register(String...) methods on this class, or using the HelidonFeatureProvider service loader interface.

    All registered features can be printed using print(HelidonFlavor, boolean) as a simple line such as:
    Helidon MP 2.0.0 features: [CDI, Config, JAX-RS, JPA, JTA, Server]
    Using this class' logger.

    When details are enabled, an additional log statement is logged, such as:

     Detailed feature tree:
     CDI
     Config
       YAML
     JAX-RS
     JPA
       Hibernate
     JTA
     Server
     
    • Method Detail

      • register

        public static void register​(HelidonFlavor flavor,
                                    String... path)
        Register a feature for a flavor. This should be called from a static initializer of a feature class. In SE this would be one of the *Support classes or similar, in MP most likely a CDI extension class.

        Example for security providers (SE) - application with Oidc provider:

        • Security calls register(SE, "security")
        • OIDC provider calls register(SE, "security", "authentication", "OIDC"
        • OIDC provider calls register(SE, "security", "outbound", "OIDC" if outbound is enabled
        Parameters:
        flavor - flavor to register a feature for
        path - path of the feature (single value for root level features)
      • register

        public static void register​(String... path)
        Register a feature for all flavors.

        Example for security providers (SE) - application with Oidc provider:

        • Security calls register(SE, "security")
        • OIDC provider calls register("security", "authentication", "OIDC"
        • OIDC provider calls register("security", "outbound", "OIDC" if outbound is enabled
        Parameters:
        path - path of the feature (single value for root level features)
      • print

        public static void print​(HelidonFlavor flavor,
                                 boolean details)
        Print features for the current flavor. If flavor(HelidonFlavor) is called, this method would only print the list if it matches the flavor provided. This is to make sure we do not print SE flavors in MP, and at the same time can have this method used from Web Server. This method only prints feature the first time it is called.
        Parameters:
        flavor - flavor to print features for
        details - set to true to print the tree structure of sub-features
      • flavor

        public static void flavor​(HelidonFlavor flavor)
        Set the current Helidon flavor. Features will only be printed for the flavor configured. The first flavor configured wins.
        Parameters:
        flavor - current flavor