public class DefaultScopedObject extends Object implements ScopedObject, Serializable
ScopedObject interface.
Simply delegates the calls to the underlying
bean factory
(BeanFactory.getBean(String)/
ConfigurableBeanFactory.destroyScopedBean(String)).
BeanFactory.getBean(java.lang.String),
ConfigurableBeanFactory.destroyScopedBean(java.lang.String),
序列化表格| 构造器和说明 |
|---|
DefaultScopedObject(org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory,
String targetBeanName)
Creates a new instance of the
DefaultScopedObject class. |
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
getTargetObject()
Return the current target object behind this scoped object proxy,
in its raw form (as stored in the target scope).
|
void |
removeFromScope()
Remove this object from its target scope, for example from
the backing session.
|
public DefaultScopedObject(org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory,
String targetBeanName)
DefaultScopedObject class.beanFactory - the ConfigurableBeanFactory that holds the scoped target objecttargetBeanName - the name of the target beanpublic Object getTargetObject()
ScopedObjectThe raw target object can for example be passed to persistence providers which would not be able to handle the scoped proxy object.
getTargetObject 在接口中 ScopedObjectpublic void removeFromScope()
ScopedObjectNote that no further calls may be made to the scoped object afterwards (at least within the current thread, that is, with the exact same target object in the target scope).
removeFromScope 在接口中 ScopedObject