org.apache.tamaya.inject.internal

## Class DefaultConfigurationInjector

- java.lang.Object
- - org.apache.tamaya.inject.internal.DefaultConfigurationInjector

- All Implemented Interfaces:
    ConfigurationInjector

      @Priority(value=0)
      public final class DefaultConfigurationInjector
      extends Object
      implements ConfigurationInjector

  Simple injector singleton that also registers instances configured using weak references.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultConfigurationInjector()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T> T` | `configure(T instance)` Configured the current instance and reigsterd necessary listener to forward config change events as defined by the current annotations in place.
    `<T> T` | `createTemplate(Class<T> templateType)` Create a template implementting the annotated methods based on current configuration data.
    `<T> ConfiguredItemSupplier<T>` | `getConfiguredSupplier(ConfiguredItemSupplier<T> supplier)` Creates a supplier for configured instances of the given type `T`.
    `ConfiguredType` | `registerTypeInternal(Class<?> type)` Extract the configuration annotation config and registers it per class, for later reuse.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultConfigurationInjector

          public DefaultConfigurationInjector()

  - ### Method Detail

    - #### registerTypeInternal

          public ConfiguredType registerTypeInternal(Class<?> type)

      Extract the configuration annotation config and registers it per class, for later reuse.
      Parameters:
        `type` - the type to be configured.
      Returns:
        the configured type registered.

    - #### configure

          public <T> T configure(T instance)

      Configured the current instance and reigsterd necessary listener to forward config change events as defined by the current annotations in place.
      Specified by:
        `configure` in interface `ConfigurationInjector`
      Parameters:
        `instance` - the instance to be configured
      Returns:
        the configured instance (allows chaining of operations).

    - #### createTemplate

          public <T> T createTemplate(Class<T> templateType)

      Create a template implementting the annotated methods based on current configuration data.
      Specified by:
        `createTemplate` in interface `ConfigurationInjector`
      Parameters:
        `templateType` - the type of the template to be created.

    - #### getConfiguredSupplier

          public <T> ConfiguredItemSupplier<T> getConfiguredSupplier(ConfiguredItemSupplier<T> supplier)

      Description copied from interface: `ConfigurationInjector`
      Creates a supplier for configured instances of the given type `T`.
      Specified by:
        `getConfiguredSupplier` in interface `ConfigurationInjector`
      Type Parameters:
        `T` - the target type.
      Parameters:
        `supplier` - the supplier to create new instances.
      Returns:
        a supplier creating configured instances of `T`.

Copyright © 2014–2015 Apache Software Foundation. All rights reserved.