Class SimpleBeanProvider
- java.lang.Object
-
- net.sf.jguiraffe.di.impl.providers.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
interface. Especially dummy implementations for the locking methods are available, which are typically not needed by simple providers.BeanProvider
- Version:
- $Id: SimpleBeanProvider.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description SimpleBeanProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<Dependency>
getDependencies()
Returns the dependencies for this bean provider.Long
getLockID()
Returns the lock ID of the current transaction.boolean
isBeanAvailable()
Returns a flag whether the managed bean is available.void
setLockID(Long lid)
Sets the lock ID of the current transaction.void
shutdown(DependencyProvider depProvider)
Shuts down thisBeanProvider
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.jguiraffe.di.BeanProvider
getBean, getBeanClass
-
-
-
-
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 interfaceBeanProvider
- 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 interfaceBeanProvider
- 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 interfaceBeanProvider
- 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 interfaceBeanProvider
- Returns:
- a flag whether the managed bean is available
-
shutdown
public void shutdown(DependencyProvider depProvider)
Shuts down thisBeanProvider
. This implementation is just an empty dummy; a simple bean provider does not need any special shutdown handling.- Specified by:
shutdown
in interfaceBeanProvider
- Parameters:
depProvider
- theDependencyProvider
-
-