|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.config.java.support.ConfigurationSupport
@Configuration public abstract class ConfigurationSupport
Convenient base class for Configurations, allowing easy lookup of beans in the owning factory as well as other services.
Constructor Summary | |
---|---|
ConfigurationSupport()
|
Method Summary | ||
---|---|---|
protected org.springframework.context.ApplicationContext |
getApplicationContext()
|
|
|
getBean(java.lang.Class<T> type)
|
|
|
getBean(java.lang.Class<T> type,
java.lang.String beanName)
|
|
java.lang.Object |
getBean(java.lang.String beanName)
|
|
protected org.springframework.beans.factory.BeanFactory |
getBeanFactory()
|
|
protected
|
getConfigured(T object)
Invoke callbacks on the object, as though it were configured in the factory. |
|
protected java.lang.Object |
getObject(org.springframework.beans.factory.FactoryBean factoryBean)
Return the object created by this FactoryBean instance, first invoking any container
callbacks on the instance. |
|
|
getObject(org.springframework.beans.factory.FactoryBean factoryBean,
java.lang.Class<T> requiredType)
Same as getObject(FactoryBean) , but checks FactoryBean.getObjectType()
against user-supplied requiredType and then casts internally to return
a strongly-typed result. |
|
void |
setApplicationContext(org.springframework.context.ApplicationContext ac)
|
|
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConfigurationSupport()
Method Detail |
---|
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
setBeanFactory
in interface org.springframework.beans.factory.BeanFactoryAware
protected org.springframework.beans.factory.BeanFactory getBeanFactory()
public void setApplicationContext(org.springframework.context.ApplicationContext ac)
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
protected org.springframework.context.ApplicationContext getApplicationContext()
public java.lang.Object getBean(java.lang.String beanName)
public <T> T getBean(java.lang.Class<T> type)
public <T> T getBean(java.lang.Class<T> type, java.lang.String beanName)
protected java.lang.Object getObject(org.springframework.beans.factory.FactoryBean factoryBean) throws FactoryBeanObjectCreationException
FactoryBean
instance, first invoking any container
callbacks on the instance.
factoryBean
- FactoryBean instance
configured
FactoryBean instance
FactoryBeanObjectCreationException
- wraps and rethrows any Exception thrown
when invoking the underlying FactoryBean.getObject()
method.FactoryBeanObjectCreationException
public <T> T getObject(org.springframework.beans.factory.FactoryBean factoryBean, java.lang.Class<T> requiredType)
getObject(FactoryBean)
, but checks FactoryBean.getObjectType()
against user-supplied requiredType and then casts internally to return
a strongly-typed result.
Note: Will likely be removed/deprecated in the Spring 3.0 timeframe, presuming that
FactoryBean will be parameterized, at which point its generics metadata can be used
directly.
T
- Expected typefactoryBean
- target FactoryBean
instancerequiredType
- Class of expected type
protected <T> T getConfigured(T object)
object
- object to configure
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |