java.lang.Object | |
↳ | org.springframework.aop.target.SingletonTargetSource |
Implementation of the TargetSource
interface
that holds a given object. This is the default implementation of the TargetSource
interface, as used by the Spring AOP framework. There is usually no need to
create objects of this class in application code.
This class is serializable. However, the actual serializability of a SingletonTargetSource will depend on whether the target is serializable.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new SingletonTargetSource for the given target.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Two invoker interceptors are equal if they have the same target or if the
targets or the targets are equal.
| |||||||||||
Return a target instance.
| |||||||||||
Return the type of targets returned by this
TargetSource . | |||||||||||
SingletonTargetSource uses the hash code of the target object.
| |||||||||||
Will all calls to
getTarget() return the same object?
In that case, there will be no need to invoke
| |||||||||||
Release the given target object obtained from the
getTarget() method. | |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.aop.TargetClassAware
| |||||||||||
From interface
org.springframework.aop.TargetSource
|
Create a new SingletonTargetSource for the given target.
target | the target object |
---|
Two invoker interceptors are equal if they have the same target or if the targets or the targets are equal.
Return a target instance. Invoked immediately before the AOP framework calls the "target" of an AOP method invocation.
Return the type of targets returned by this TargetSource
.
Can return null
, although certain usages of a
TargetSource
might just work with a predetermined
target class.
TargetSource
SingletonTargetSource uses the hash code of the target object.
Will all calls to getTarget()
return the same object?
In that case, there will be no need to invoke
releaseTarget(Object)
, and the AOP framework can cache
the return value of getTarget()
.
true
if the target is immutableRelease the given target object obtained from the
getTarget()
method.
target | object obtained from a call to getTarget() |
---|