public class ScopedProxyFactoryBean extends ProxyConfig implements org.springframework.beans.factory.FactoryBean<Object>, org.springframework.beans.factory.BeanFactoryAware
Proxies created using this factory bean are thread-safe singletons and may be injected into shared objects, with transparent scoping behavior.
Proxies returned by this class implement the ScopedObject
interface.
This presently allows for removing the corresponding object from the scope,
seamlessly creating a new instance in the scope on next access.
Please note that the proxies created by this factory are class-based proxies by default. This can be customized through switching the "proxyTargetClass" property to "false".
ProxyConfig.setProxyTargetClass(boolean)
,
Serialized FormConstructor and Description |
---|
ScopedProxyFactoryBean()
Create a new ScopedProxyFactoryBean instance.
|
Modifier and Type | Method and Description |
---|---|
Object |
getObject() |
Class<?> |
getObjectType() |
boolean |
isSingleton() |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
void |
setTargetBeanName(String targetBeanName)
Set the name of the bean that is to be scoped.
|
copyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass, toString
public ScopedProxyFactoryBean()
public void setTargetBeanName(String targetBeanName)
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
setBeanFactory
in interface org.springframework.beans.factory.BeanFactoryAware
public Object getObject()
getObject
in interface org.springframework.beans.factory.FactoryBean<Object>
public Class<?> getObjectType()
getObjectType
in interface org.springframework.beans.factory.FactoryBean<Object>
public boolean isSingleton()
isSingleton
in interface org.springframework.beans.factory.FactoryBean<Object>