Annotation 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 -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionboolean
Determines whether this instance will be activated if created.
-
Element Details
-
value
Class<?> valueThe prototype class that drives this config driven.- Returns:
- the prototype that is configured
-
activateByDefault
boolean activateByDefaultDetermines whether this instance will be activated if created. The default value isfalse
.- Returns:
- true if the presence of the config bean has an activation affect
- Default:
false
-