public class FactoryBeanProvider extends LifeCycleBeanProvider
A specialized life-cycle supporting
implementation for creating new bean instances on each invocation.
BeanProvider
Each time an instance of this class is invoked in a transaction a new instance of the managed bean class will be created. The implementation ensures that reentrant calls in a transaction always return the same bean instance, so in each transaction exactly one bean is created.
Constructor and Description |
---|
FactoryBeanProvider(BeanProvider createProvider)
Creates a new instance of
FactoryBeanProvider and
initializes it with the bean provider for creating a bean instance. |
FactoryBeanProvider(BeanProvider createProvider,
Invokable initinv)
Creates a new instance of
FactoryBeanProvider and
initializes it with the bean provider for creating a bean instance and
the invocation object for performing initialization. |
Modifier and Type | Method and Description |
---|---|
Object |
getBean(DependencyProvider dependencyProvider)
Returns the bean managed by this bean provider.
|
void |
setLockID(Long lid)
Sets the ID of the locking transaction.
|
canInitialize, createBean, doCreateBean, fetchBean, fetchInitializedBeanInstance, getBeanClass, getBeanCreator, getBeanInitializer, getDependencies, getLockID, hasBean, initBean, initialize, isBeanAvailable, resetBean, shutdown, toString
public FactoryBeanProvider(BeanProvider createProvider, Invokable initinv)
FactoryBeanProvider
and
initializes it with the bean provider for creating a bean instance and
the invocation object for performing initialization.createProvider
- the bean provider used for creating a new bean
instance (must not be null)initinv
- the (optional) invocation object for performing
initializationIllegalArgumentException
- if the bean provider is undefinedpublic FactoryBeanProvider(BeanProvider createProvider)
FactoryBeanProvider
and
initializes it with the bean provider for creating a bean instance.createProvider
- the bean provider used for creating a new bean
instance (must not be null)IllegalArgumentException
- if the bean provider is undefinedpublic Object getBean(DependencyProvider dependencyProvider)
dependencyProvider
- the dependency providerpublic void setLockID(Long lid)
setLockID
in interface BeanProvider
setLockID
in class LifeCycleBeanProvider
lid
- the ID of the locking transactionBeanProvider.getLockID()
Copyright © 2016 The JGUIraffe Team. All rights reserved.