Class PopulateStoreFromDefine<V extends BeanInitialization>

Object
PopulateStoreFromDefine<V>
Type Parameters:
V - initialization-parameters for provider

public class PopulateStoreFromDefine<V extends BeanInitialization> extends Object
Helps populates a NamedProviderStore from the contents of a Define.

Objects can be added directly (no initialization) or with initialization.

Author:
Owen Feehan
  • Constructor Details

    • PopulateStoreFromDefine

      public PopulateStoreFromDefine(Define define, BeanInitializer<?> propertyInitializer, Logger logger)
      Creates a new PopulateStoreFromDefine instance.
      Parameters:
      define - Define source for objects.
      propertyInitializer - Initializes the properties of objects, where initialization is required.
      logger - Passed to objects added with initialization.
  • Method Details

    • copyWithoutInitialize

      public <S extends AnchorBean<S>> void copyWithoutInitialize(Class<?> defineClass, NamedProviderStore<S> destination) throws OperationFailedException
      Copies objects of a particular class from the define without performing any initialization.
      Type Parameters:
      S - type of objects
      Parameters:
      defineClass - class to identify objects in define.
      destination - where to copy to.
      Throws:
      OperationFailedException - if the identifier already exists, or otherwise the add operation fails.
    • copyInitialize

      public <S extends InitializableBean<S, V>> void copyInitialize(Class<?> defineClass, NamedProviderStore<S> destination) throws OperationFailedException
      Copies objects of a particular class from the define and initializes.
      Type Parameters:
      S - type of objects
      Parameters:
      defineClass - class to identify objects in define.
      destination - where to copy to.
      Throws:
      OperationFailedException - if a copied identifier already exists, or otherwise the add operation fails.
    • copyProviderInitialize

      public <S extends InitializableBean<?, V> & Provider<T>, T> void copyProviderInitialize(Class<?> defineClass, NamedProviderStore<T> destination) throws OperationFailedException
      Copies objects of a particular class (which must be a Provider) from define and initializes each.

      Specifically, each object will be lazily initialized once when first retrieved from the store.

      Type Parameters:
      S - type of provider-objects
      T - type of objects created by the provider
      Parameters:
      defineClass - class to identify objects in define.
      destination - where to copy to.
      Throws:
      OperationFailedException - if a copied identifier already exists, or otherwise the add operation fails.