Top Description Fields Constructors Methods
org.springframework.aop.scope

public Class DefaultScopedObject

extends Object
implements ScopedObject, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.springframework.aop.scope.ScopedObject, org.springframework.aop.RawTargetAccess
Annotations
@SuppressWarnings:serial
Imports
java.io.Serializable, org.springframework.beans.factory.config.ConfigurableBeanFactory, org.springframework.util.Assert

Default implementation of the ScopedObject interface.

Simply delegates the calls to the underlying bean factory (ConfigurableBeanFactory#getBean(String)/ ConfigurableBeanFactory#destroyScopedBean(String)).

Author
Juergen Hoeller
Since
2.0
See Also
org.springframework.beans.factory.BeanFactory#getBean, org.springframework.beans.factory.config.ConfigurableBeanFactory#destroyScopedBean

Field Summary

Modifier and TypeField and Description
private final ConfigurableBeanFactory
private final String

Constructor Summary

AccessConstructor and Description
public
DefaultScopedObject(ConfigurableBeanFactory
the ConfigurableBeanFactory that holds the scoped target object
beanFactory
,
String
the name of the target bean
targetBeanName
)

Creates a new instance of the DefaultScopedObject class.

Method Summary

Modifier and TypeMethod and Description
public Object
getTargetObject()

Implements org.springframework.aop.scope.ScopedObject.getTargetObject.

Return the current target object behind this scoped object proxy, in its raw form (as stored in the target scope).
public void
removeFromScope()

Implements org.springframework.aop.scope.ScopedObject.removeFromScope.

Remove this object from its target scope, for example from the backing session.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

beanFactoryback to summary
private final ConfigurableBeanFactory beanFactory
targetBeanNameback to summary
private final String targetBeanName

Constructor Detail

DefaultScopedObjectback to summary
public DefaultScopedObject(ConfigurableBeanFactory beanFactory, String targetBeanName)

Creates a new instance of the DefaultScopedObject class.

Parameters
beanFactory:ConfigurableBeanFactory

the ConfigurableBeanFactory that holds the scoped target object

targetBeanName:String

the name of the target bean

Method Detail

getTargetObjectback to summary
public Object getTargetObject()

Implements org.springframework.aop.scope.ScopedObject.getTargetObject.

Doc from org.springframework.aop.scope.ScopedObject.getTargetObject.

Return the current target object behind this scoped object proxy, in its raw form (as stored in the target scope).

The raw target object can for example be passed to persistence providers which would not be able to handle the scoped proxy object.

Returns:Object

the current target object behind this scoped object proxy

Annotations
@Override
removeFromScopeback to summary
public void removeFromScope()

Implements org.springframework.aop.scope.ScopedObject.removeFromScope.

Doc from org.springframework.aop.scope.ScopedObject.removeFromScope.

Remove this object from its target scope, for example from the backing session.

Note 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).

Annotations
@Override