Interface BeanStore

  • All Known Subinterfaces:
    MutableBeanStore
    All Known Implementing Classes:
    CombinedBeanStore, DefaultBeanStore, JellyContextBeanStore, SimpleBeanStoreImpl

    public interface BeanStore

    Definition of an interface for objects that provide access to bean definitions.

    A BeanStore maintains an arbitrary number of bean definitions, which are identified by unique names. It is possible to list the names of all available bean definitions, and to access a specific bean definition by its name.

    BeanStores are hierarchical structures: they can have a parent. A typical search algorithm an a BeanStore will first query the local store, and then - if the specified bean definition could not be found - delegate to its parent store. This allows for complex scenarios where global objects can be defined on the application level, while certain sub contexts have the opportunity of overriding some definitions and define their own local data.

    This interface is kept quite simple. It should be easy to implement it, e.g. using a map or another context-like object.

    Version:
    $Id: BeanStore.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Method Detail

      • getBeanProvider

        BeanProvider getBeanProvider​(String name)
        Returns the BeanProvider that is registered under the given name or null if cannot be found.
        Parameters:
        name - the name of the BeanProvider
        Returns:
        the provider registered under this name or null
      • providerNames

        Set<String> providerNames()
        Returns a set with the names of all BeanProvider objects that are registered in this bean store.
        Returns:
        a set with the names of the contained BeanProviders
      • getName

        String getName()
        Returns a name for this bean store. The name is mainly used for grouping and accessing bean stores. It does not have a direct impact on bean creation or dependency injection.
        Returns:
        a name for this bean store
      • getParent

        BeanStore getParent()
        Returns a reference to the parent BeanStore. Bean stores can be organized in a hierarchical manner: if a bean provider cannot be found in a specific bean store, the framework will also search its parent bean store (and recursively the parent's parent, and so on). This makes it possible to create different scopes of beans. The root store should return null.
        Returns:
        the parent bean store or null if this is the root store
      • getConversionHelper

        ConversionHelper getConversionHelper()
        Returns a ConversionHelper object for performing type conversions on the beans contained in this BeanStore. To the hierarchy of BeanStore objects also ConversionHelper objects can be added. This is useful when dealing with specialized beans for which custom converters have to be provided. A ConversionHelper is optional, so an implementation can return null. It is then up to the caller whether it uses a default ConversionHelper instance or tries to query the parent bean store.
        Returns:
        a ConversionHelper instance for performing type conversions related to the beans contained in this store