public class CreateOrReuseFactoryBean<T>
extends java.lang.Object
implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean
FactoryBean implementation to provide either a new bean, created on
the first injection, or the previously-created bean thereafter.
This is slightly different than letting the Spring container handle this behaviour as the instance will come from
the given Supplier the first time around.
| Constructor and Description |
|---|
CreateOrReuseFactoryBean(java.lang.String self,
java.lang.Class<T> type,
reactor.function.Supplier<T> supplier) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
T |
getObject() |
java.lang.Class<?> |
getObjectType() |
boolean |
isSingleton() |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
throws org.springframework.beans.BeansException
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAwareorg.springframework.beans.BeansExceptionpublic void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionpublic T getObject() throws java.lang.Exception
getObject in interface org.springframework.beans.factory.FactoryBean<T>java.lang.Exceptionpublic java.lang.Class<?> getObjectType()
getObjectType in interface org.springframework.beans.factory.FactoryBean<T>public boolean isSingleton()
isSingleton in interface org.springframework.beans.factory.FactoryBean<T>