Annotation Type ConfiguredBy


  • @Documented
    @Scope
    @Retention(RUNTIME)
    @Target(TYPE)
    public @interface ConfiguredBy
    This annotation is put onto classes to indicate that they should be created based on the availability of instances of a specify type of configuration in the Hub
    Author:
    jwells
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      String value
      A service is created for each instance of this type, with a name taken from the key of the instance
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      ConfiguredBy.CreationPolicy creationPolicy
      Specifies the creation policy for configured services based on type instances.
    • Element Detail

      • value

        String value
        A service is created for each instance of this type, with a name taken from the key of the instance
        Returns:
        the name of the type to base instances of this service on
      • creationPolicy

        ConfiguredBy.CreationPolicy creationPolicy
        Specifies the creation policy for configured services based on type instances. The values it can take are:
        • ON_DEMAND - Services are created when user code creates demand (via lookup or injection)
        • EAGER - Services are created as soon as configured instances become available
        The default value is ON_DEMAND
        Returns:
        The creation policy for services configured by this type
        Default:
        org.glassfish.hk2.configuration.api.ConfiguredBy.CreationPolicy.ON_DEMAND