spring-framework / org.springframework.aop.scope / ScopedProxyFactoryBean

ScopedProxyFactoryBean

open class ScopedProxyFactoryBean : ProxyConfig, FactoryBean<Any>, BeanFactoryAware

Convenient proxy factory bean for scoped objects.

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".

Author
Rod Johnson

Author
Juergen Hoeller

Since
2.0

See Also
#setProxyTargetClass

Constructors

<init>

ScopedProxyFactoryBean()

Create a new ScopedProxyFactoryBean instance.

Functions

getObject

open fun getObject(): Any

getObjectType

open fun getObjectType(): Class<*>

isSingleton

open fun isSingleton(): Boolean

setBeanFactory

open fun setBeanFactory(beanFactory: BeanFactory): Unit

setTargetBeanName

open fun setTargetBeanName(targetBeanName: String): Unit

Set the name of the bean that is to be scoped.