T - - type of beanpublic abstract class ApplicationContextAwareFactoryBean<T>
extends java.lang.Object
implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
FactoryBean with access to ApplicationContext with lazy
initialization| Constructor and Description |
|---|
ApplicationContextAwareFactoryBean() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet()
Instantiates supplier for bean to be created.
|
protected abstract T |
createInstance()
Template method that subclasses must override to construct the object
returned by this factory.
|
protected org.springframework.context.ApplicationContext |
getApplicationContext() |
T |
getObject() |
boolean |
isSingleton() |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setSingleton(boolean singleton) |
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic T getObject() throws java.lang.Exception
getObject in interface org.springframework.beans.factory.FactoryBean<T>java.lang.Exceptionpublic boolean isSingleton()
isSingleton in interface org.springframework.beans.factory.FactoryBean<T>public void setSingleton(boolean singleton)
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionprotected org.springframework.context.ApplicationContext getApplicationContext()
protected abstract T createInstance()
Invoked on initialization of this FactoryBean in case of a singleton;
else, on each getObject() call.
getObject()