public interface ScopedObject extends RawTargetAccess
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.
ScopedProxyFactoryBean
Modifier and Type | Method and Description |
---|---|
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.
|
Object getTargetObject()
The raw target object can for example be passed to persistence providers which would not be able to handle the scoped proxy object.
void removeFromScope()
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).