Top Description Methods
org.springframework.aop.scope

public Interface ScopedObject

extends RawTargetAccess
Known Direct Implementers
org.springframework.aop.scope.DefaultScopedObject
Imports
org.springframework.aop.RawTargetAccess

An AOP introduction interface for scoped objects.

Objects created from the ScopedProxyFactoryBean can be cast to this interface, enabling access to the raw target object and programmatic removal of the target object.

Authors
Rod Johnson, Juergen Hoeller
Since
2.0
See Also
ScopedProxyFactoryBean

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

the current target object behind this scoped object proxy
getTargetObject
()

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

public void
removeFromScope()

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

Method Detail

getTargetObjectback to summary
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:Object

the current target object behind this scoped object proxy

removeFromScopeback to summary
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).