Annotation Interface ConfigDriven


@Documented @Retention(CLASS) @Target(TYPE) @Qualifier public @interface ConfigDriven
A config driven service is based on a prototype that is configured from the root of configuration (see Configured in helidon-config-metadata).

The annotation is placed on the service implementation (not contract, as we need to understand which type to instantiate), and the prototype is expected to be one of the constructor parameters (annotated with @Inject). In case the configured prototype is repeatable, each instance will be named according to the name specified in configuration either through name property, or the config node name.

Example:

 @ConfigDriven(value = ServerConfig.class, activateByDefault  = true, atLeastOne = true)
 class ServerImpl {
   @Inject
   ServerImpl(ServerConfig sc) {
   }
 }
 
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The prototype class that drives this config driven.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Determines whether this instance will be activated if created.
  • Element Details

    • value

      Class<?> value
      The prototype class that drives this config driven.
      Returns:
      the prototype that is configured
    • activateByDefault

      boolean activateByDefault
      Determines whether this instance will be activated if created. The default value is false.
      Returns:
      true if the presence of the config bean has an activation affect
      Default:
      false