public class

DefaultScopedObject

extends Object
implements Serializable ScopedObject
java.lang.Object
   ↳ org.springframework.aop.scope.DefaultScopedObject

Class Overview

Default implementation of the ScopedObject interface.

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

Summary

Public Constructors
DefaultScopedObject(ConfigurableBeanFactory beanFactory, String targetBeanName)
Creates a new instance of the DefaultScopedObject class.
Public Methods
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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.aop.scope.ScopedObject

Public Constructors

public DefaultScopedObject (ConfigurableBeanFactory beanFactory, String targetBeanName)

Creates a new instance of the DefaultScopedObject class.

Parameters
beanFactory the ConfigurableBeanFactory that holds the scoped target object
targetBeanName the name of the target bean

Public Methods

public Object 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
  • the current target object behind this scoped object proxy

public void 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).