Class PicoServicesConfig

java.lang.Object
io.helidon.pico.api.PicoServicesConfig

public abstract class PicoServicesConfig extends Object
This is the configuration that the Pico service provider uses internally.

If left as-is a default configuration instance will be used with default values provided herein. Callers can optionally configure values by providing a Bootstrap.config() prior to Pico startup. The configuration provided will be used, and tunable configuration must be located under the key NAME within the provided configuration element.

  • Field Details

    • NAME

      public static final String NAME
      The short name for pico.
      See Also:
    • FQN

      public static final String FQN
      The fully qualified name for pico.
      See Also:
    • KEY_PROVIDER_NAME

      public static final String KEY_PROVIDER_NAME
      The key association with the name of the provider implementation.
      See Also:
    • TAG_DEBUG

      public static final String TAG_DEBUG
      Tag for putting Pico tooling, processing, and runtime into debug mode.
      See Also:
    • TAG_MODULE_NAME

      public static final String TAG_MODULE_NAME
      Identify the module name being processed or the desired target module name.
      See Also:
    • KEY_PROVIDER_VERSION

      public static final String KEY_PROVIDER_VERSION
      The key association with the version of the provider implementation.
      See Also:
    • KEY_ACTIVATION_DEADLOCK_TIMEOUT_IN_MILLIS

      public static final String KEY_ACTIVATION_DEADLOCK_TIMEOUT_IN_MILLIS
      Applicable during activation, this is the key that controls the timeout before deadlock detection exceptions are thrown.

      Deadlock can occur in situations where there are cyclic, non-Provider<> type dependencies between two services, e.g., A -> B and B -> A. Obviously this example is the simplest of cases. More often cyclic dependencies are nested N levels deep.

      Pico may attempt to resolve cyclic dependencies, but this timeout will govern how long Pico will wait before giving up and instead will result in an exception being thrown.

      There are two best practices recommended:

      1. Use Provider<> as often as possible. If a service activation does not a dependency during PostConstruct then there is really no need to have a direct dependency to that service.
      2. Use compile-time Application generation. See the Pico maven-plugin module for details. Use of this feature will detect all cyclic dependencies at compile-time and will result in faster startup times.
      See Also:
    • DEFAULT_ACTIVATION_DEADLOCK_TIMEOUT_IN_MILLIS

      public static final String DEFAULT_ACTIVATION_DEADLOCK_TIMEOUT_IN_MILLIS
      The default deadlock detection timeout in millis.
      See Also:
    • KEY_ACTIVATION_LOGS

      public static final String KEY_ACTIVATION_LOGS
      Applicable for enabling the capture of activation logs at Pico startup.
      See Also:
    • DEFAULT_ACTIVATION_LOGS

      public static final String DEFAULT_ACTIVATION_LOGS
      The default value for this is false, meaning that the activation logs will not be captured or recorded or logged.
      See Also:
    • KEY_SERVICE_LOOKUP_CACHING

      public static final String KEY_SERVICE_LOOKUP_CACHING
      Applicable for enabling service lookup caching.
      See Also:
    • DEFAULT_SERVICE_LOOKUP_CACHING

      public static final String DEFAULT_SERVICE_LOOKUP_CACHING
      The default value for this is false, meaning that no caching will occur.
      See Also:
    • KEY_PERMITS_DYNAMIC

      public static final String KEY_PERMITS_DYNAMIC
      The key that controls whether the Services registry is permitted to expand or be dynamically altered after JVM startup.
      See Also:
    • DEFAULT_PERMITS_DYNAMIC

      public static final String DEFAULT_PERMITS_DYNAMIC
      The default value for this is false, meaning that the services registry can be changed during runtime post Pico startup.
      See Also:
    • KEY_SUPPORTS_DYNAMIC

      public static final String KEY_SUPPORTS_DYNAMIC
      The key that indicates whether the Services registry is capable of expanding or being dynamically altered after JVM startup. This is referred to as the service registry being dynamic in nature.
      See Also:
    • DEFAULT_SUPPORTS_DYNAMIC

      public static final String DEFAULT_SUPPORTS_DYNAMIC
      The default value for this is false, meaning that the services registry supports dynamic behavior post Pico startup.
      See Also:
    • KEY_PERMITS_REFLECTION

      public static final String KEY_PERMITS_REFLECTION
      The key that controls whether reflection is permitted to be used during Pico runtime operations. The default implementation of Pico does not support runtime reflection usage; it is only supported via the Pico maven-plugin and supporting tooling, which typically occurs during compile-time operations but not during normal runtime operations.
      See Also:
    • DEFAULT_PERMITS_REFLECTION

      public static final String DEFAULT_PERMITS_REFLECTION
      The default value for this is false, meaning that the Pico will make not attempt to use reflection during runtime operations.
      See Also:
    • KEY_SUPPORTS_REFLECTION

      public static final String KEY_SUPPORTS_REFLECTION
      The key that indicates whether the reflection is supported in normal runtime behavior.
      See Also:
    • DEFAULT_SUPPORTS_REFLECTION

      public static final String DEFAULT_SUPPORTS_REFLECTION
      The default value for this is false, meaning that the reflection is not supported by the provider.
      See Also:
    • KEY_USES_COMPILE_TIME_APPLICATIONS

      public static final String KEY_USES_COMPILE_TIME_APPLICATIONS
      The key that controls whether any Application's (typically produced at compile-time by Pico tooling) can be discovered and is used during Pico startup processing. It is strongly suggested for developers to adopt a compile-time strategy for producing the dependency/injection model as it will lead to faster startup times as well as be deterministic and validated during compile-time instead of at runtime.
      See Also:
    • DEFAULT_USES_COMPILE_TIME_APPLICATIONS

      public static final String DEFAULT_USES_COMPILE_TIME_APPLICATIONS
      The default value for this is true, meaning that the Pico will attempt to find and use Application code generated during compile-time (see Pico's APT processor and maven-plugin modules for usage).
      See Also:
    • KEY_USES_COMPILE_TIME_MODULES

      public static final String KEY_USES_COMPILE_TIME_MODULES
      The key that controls whether any Module's (typically produced at compile-time by Pico tooling) can be discovered and is used during Pico startup processing. It is strongly suggested for developers to adopt a compile-time strategy for producing the dependency/injection model as it will lead to faster startup times as well as be deterministic and validated during compile-time instead of at runtime.
      See Also:
    • DEFAULT_USES_COMPILE_TIME_MODULES

      public static final String DEFAULT_USES_COMPILE_TIME_MODULES
      The default value for this is true, meaning that the Pico will attempt to find and use Module code generated during compile-time (see Pico's APT processor and maven-plugin modules for usage).
      See Also:
    • KEY_SUPPORTS_COMPILE_TIME

      public static final String KEY_SUPPORTS_COMPILE_TIME
      The key that represents whether the provider supports compile-time code generation of DI artifacts.
      See Also:
    • DEFAULT_SUPPORTS_COMPILE_TIME

      public static final String DEFAULT_SUPPORTS_COMPILE_TIME
      The default value is true, meaning that the provider supports compile-time code generation of DI artifacts.
      See Also:
    • KEY_USES_JSR330

      public static final String KEY_USES_JSR330
      The key that controls whether strict jsr330 specification interpretation is used. See the README for additional details.
      See Also:
    • DEFAULT_USES_JSR330

      public static final String DEFAULT_USES_JSR330
      The default value for this is false, meaning that the Pico implementation will not follow a strict jsr330 interpretation of the specification. See the README for additional details.
      See Also:
    • KEY_SUPPORTS_JSR330

      public static final String KEY_SUPPORTS_JSR330
      The key to represent whether the provider supports the jsr330 specification.
      See Also:
    • DEFAULT_SUPPORTS_JSR330

      public static final String DEFAULT_SUPPORTS_JSR330
      The default value is true, meaning that the default Pico implementation supports the jsr330 specification (i.e., one that passes the jsr330 TCK).
      See Also:
    • KEY_SUPPORTS_JSR330_STATICS

      public static final String KEY_SUPPORTS_JSR330_STATICS
      Key indicating support for static injection points. Note: this is optional in jsr330.
      See Also:
    • DEFAULT_SUPPORTS_JSR330_STATICS

      public static final String DEFAULT_SUPPORTS_JSR330_STATICS
      The default value is false, meaning that the default provider implementation does not support static injection points.
      See Also:
    • KEY_SUPPORTS_JSR330_PRIVATES

      public static final String KEY_SUPPORTS_JSR330_PRIVATES
      Key indicating support for private injection points. Note: this is optional in jsr330.
      See Also:
    • DEFAULT_SUPPORTS_JSR330_PRIVATES

      public static final String DEFAULT_SUPPORTS_JSR330_PRIVATES
      The default value is false, meaning that the default provider implementation does not support private injection points.
      See Also:
    • KEY_SUPPORTS_CONTEXTUAL_LOOKUP

      public static final String KEY_SUPPORTS_CONTEXTUAL_LOOKUP
      Key indicating support for contextual lookup via Services.contextualServices(InjectionPointInfo).
      See Also:
    • DEFAULT_SUPPORTS_CONTEXTUAL_LOOKUP

      public static final String DEFAULT_SUPPORTS_CONTEXTUAL_LOOKUP
      The default value is false, meaning that contextual lookup is not supported.
      See Also:
  • Constructor Details

    • PicoServicesConfig

      protected PicoServicesConfig()
      Default Constructor.
  • Method Details

    • providerName

      public abstract String providerName()
      The provider implementation name.
      Returns:
      the provider implementation name
    • providerVersion

      public abstract String providerVersion()
      The provider implementation version.
      Returns:
      the provider implementation version
    • activationDeadlockDetectionTimeoutMillis

      public long activationDeadlockDetectionTimeoutMillis()
      The deadlock detection timeout in millis.
      Returns:
      the deadlock detection timeout in mills
    • activationLogs

      public boolean activationLogs()
      Flag indicating whether activation logs are captured, recorded, and retained.
      Returns:
      the flag indicating whether activation logs are captured and retained
    • serviceLookupCaching

      public boolean serviceLookupCaching()
      Flag indicating whether service lookups (i.e., via Services.lookup(java.lang.Class<T>)) are cached.
      Returns:
      the flag indicating whether service lookups are cached
    • permitsDynamic

      public boolean permitsDynamic()
      Flag indicating whether the services registry permits dynamic behavior (key is KEY_PERMITS_DYNAMIC). The default implementation of Pico supports dynamic (see supportsDynamic()), but does not permit it by default.
      Returns:
      the flag indicating whether the services registry supports dynamic updates of the service registry
    • supportsDynamic

      public abstract boolean supportsDynamic()
      Flag indicating whether the services registry supports dynamic behavior (key is KEY_SUPPORTS_DYNAMIC). Note that if the provider does not support this flag then permitting it via permitsDynamic() will have no affect. The default implementation of Pico supports dynamic, but does not permit it by default.
      Returns:
      the flag indicating whether the services registry supports dynamic updates of the service registry post Pico startup
    • permitsReflection

      public boolean permitsReflection()
      Flag indicating whether reflection is permitted (key is KEY_PERMITS_DYNAMIC). The default implementation of Pico supports reflection at compile-time only, and is not controlled by this flag directly.
      Returns:
      the flag indicating whether the provider is permitted to use reflection for normal runtime usage
    • supportsReflection

      public abstract boolean supportsReflection()
      Flag indicating whether the reflection is supported. Note that if the provider does not support this flag then permitting it via permitsReflection() will have no affect. The default implementation of Pico supports reflection only during compile-time operations using the Pico maven-plugin.
      Returns:
      the flag indicating whether reflection is supported during runtime operations
    • usesCompileTimeApplications

      public boolean usesCompileTimeApplications()
      Flag indicating whether compile-time generated Application's should be used at Pico's startup initialization. Setting this value to false will have no affect if the underlying provider does not support compile-time generation via supportsCompileTime().
      Returns:
      the flag indicating whether the provider is permitted to use Application generated code from compile-time
      See Also:
    • usesCompileTimeModules

      public boolean usesCompileTimeModules()
      Flag indicating whether compile-time generated Module's should be used at Pico's startup initialization. Setting this value to false will have no affect if the underlying provider does not support compile-time generation via supportsCompileTime().
      Returns:
      the flag indicating whether the provider is permitted to use Application generated code from compile-time
      See Also:
    • supportsCompileTime

      public abstract boolean supportsCompileTime()
      Flag indicating whether the dependency injection model for the Application and Activator is capable for being produced at compile-time, and therefore used/loaded during runtime operations.
      Returns:
      the flag indicating whether the provider supports compile-time code generation of DI artifacts
    • usesJsr330

      public boolean usesJsr330()
      Flag indicating whether jsr330 specification will be used and enforced.
      Returns:
      the flag indicating whether strict jsr330 specification will be enforced
    • supportsJsr330

      public abstract boolean supportsJsr330()
      Flag indicating whether jsr330 is supported by the provider implementation.
      Returns:
      the flag indicating whether the provider supports the jsr330 specification
    • supportsJsr330Statics

      public abstract boolean supportsJsr330Statics()
      Flag indicating whether jsr330 is supported by the provider implementation for the use on static injection points.
      Returns:
      the flag indicating whether the provider supports the jsr330 specification for the use of static injection points
    • supportsJsr330Privates

      public abstract boolean supportsJsr330Privates()
      Flag indicating whether jsr330 is supported by the provider implementation for the use on private injection points.
      Returns:
      the flag indicating whether the provider supports the jsr330 specification for the use of private injection points
    • supportsContextualLookup

      public abstract boolean supportsContextualLookup()
      Flag indicating whether contextual lookup is supported via Services.contextualServices(InjectionPointInfo).
      Returns:
      the flag indicating whether the provider supports contextual lookup