Class SimpleBeanProvider

  • All Implemented Interfaces:
    BeanProvider
    Direct Known Subclasses:
    CollectionBeanProvider, ConstantBeanProvider, ConstructorBeanProvider, MapBeanProvider, MethodInvocationBeanProvider

    public abstract class SimpleBeanProvider
    extends Object
    implements BeanProvider

    A base class for simple bean providers.

    A simple BeanProvider is a bean provider that only cares for creating new bean instances. It does not have further support for life-cycle features. Bean providers of this type are intended to collaborate with a life-cycle-aware bean provider. This provider uses the simple bean provider just for the creation and implements specific initialization functionality.

    This base class provides implementations for some of the methods defined in the BeanProvider interface. Especially dummy implementations for the locking methods are available, which are typically not needed by simple providers.

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

      • SimpleBeanProvider

        public SimpleBeanProvider()
    • Method Detail

      • getDependencies

        public Set<Dependency> getDependencies()
        Returns the dependencies for this bean provider. This implementation simply returns null. Simple providers often do not have any dependencies.
        Specified by:
        getDependencies in interface BeanProvider
        Returns:
        a set with the dependencies of this bean provider
        See Also:
        Dependency
      • getLockID

        public Long getLockID()
        Returns the lock ID of the current transaction. Simple bean providers do not require any lock handling. So this implementation always returns null.
        Specified by:
        getLockID in interface BeanProvider
        Returns:
        the lock ID of the current transaction
      • setLockID

        public void setLockID​(Long lid)
        Sets the lock ID of the current transaction. This is just a dummy implementation; simple bean providers do not need any lock handling.
        Specified by:
        setLockID in interface BeanProvider
        Parameters:
        lid - the lock ID of the current transaction
        See Also:
        BeanProvider.getLockID()
      • isBeanAvailable

        public boolean isBeanAvailable()
        Returns a flag whether the managed bean is available. For simple bean providers this is always the case, so this implementation always returns true.
        Specified by:
        isBeanAvailable in interface BeanProvider
        Returns:
        a flag whether the managed bean is available
      • shutdown

        public void shutdown​(DependencyProvider depProvider)
        Shuts down this BeanProvider. This implementation is just an empty dummy; a simple bean provider does not need any special shutdown handling.
        Specified by:
        shutdown in interface BeanProvider
        Parameters:
        depProvider - the DependencyProvider