Interface MutableBeanStore

  • All Superinterfaces:
    BeanStore
    All Known Implementing Classes:
    DefaultBeanStore

    public interface MutableBeanStore
    extends BeanStore

    Definition of an interface for a BeanStore that can be manipulated.

    This interface inherits from the basic BeanStore interface and adds a set of methods to it that allow for changes of the store, i.e. adding/ removing bean providers or cleaning the whole store.

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

      • addBeanProvider

        void addBeanProvider​(String name,
                             BeanProvider provider)
        Adds the specified BeanProvider to this bean store under the given name.
        Parameters:
        name - the name of the bean provider (must not be null)
        provider - the BeanProvider to be registered
        Throws:
        IllegalArgumentException - if the name or the provider is null
      • addAnonymousBeanProvider

        String addAnonymousBeanProvider​(int index,
                                        BeanProvider provider)
        Adds an anonymous BeanProvider to this BeanStore. It is possible to define beans in the context of a dependency tag (e.g. a <param> tag); then this bean is only visible in this narrow context and cannot be accessed from elsewhere. This makes sense for beans that are used only once and are not shared between different components; then defining the bean directly at the point where it is used is more readable. Such beans do not have a real name, but an internal name is generated by this method, which is treated specially. For instance, internal names won't be returned by the providerNames() methods. The passed in index parameter is used for generating a unique name for the provider. It is in the responsibility of the caller to pass in unique numbers.
        Parameters:
        index - the index of the BeanProvider
        provider - the BeanProvider to be registered (must not be null)
        Returns:
        the generated name for this BeanProvider
        Throws:
        IllegalArgumentException - if the BeanProvider is null
      • removeBeanProvider

        BeanProvider removeBeanProvider​(String name)
        Removes the BeanProvider with the specified name from this bean store. If this provider cannot be found, this operation has no effect.
        Parameters:
        name - the name of the provider to remove
        Returns:
        a reference to the removed provider or null if it could not be found
      • clear

        void clear()
        Removes all BeanProviders from this bean store.
      • setName

        void setName​(String n)
        Sets the name of this bean store.
        Parameters:
        n - the new name
      • setParent

        void setParent​(BeanStore p)
        Sets the parent for this bean store.
        Parameters:
        p - the parent