- java.lang.Object
-
- io.helidon.common.HelidonFeatures
-
public final class HelidonFeatures extends Object
Helidon Features support.A feature can register using either
register(HelidonFlavor, String...)orregister(String...)methods on this class, or using theHelidonFeatureProviderservice 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 Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidflavor(HelidonFlavor flavor)Set the current Helidon flavor.static voidprint(HelidonFlavor flavor, boolean details)Print features for the current flavor.static voidregister(HelidonFlavor flavor, String... path)Register a feature for a flavor.static voidregister(String... path)Register a feature for all flavors.
-
-
-
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 forpath- path of the feature (single value for root level features)
- Security calls
-
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)
- Security calls
-
print
public static void print(HelidonFlavor flavor, boolean details)
Print features for the current flavor. Ifflavor(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 fordetails- set totrueto 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
-
-