java.lang.Object | |
↳ | org.springframework.aop.target.HotSwappableTargetSource |
TargetSource
implementation that
caches a local target object, but allows the target to be swapped
while the application is running.
If configuring an object of this class in a Spring IoC container, use constructor injection.
This TargetSource is serializable if the target is at the time of serialization.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new HotSwappableTargetSource with the given initial target object.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Two HotSwappableTargetSources are equal if the current target
objects are equal.
| |||||||||||
Return a target instance.
| |||||||||||
Return the type of the current 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. | |||||||||||
Swap the target, returning the old target object.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.aop.TargetClassAware
| |||||||||||
From interface
org.springframework.aop.TargetSource
|
Create a new HotSwappableTargetSource with the given initial target object.
initialTarget | the initial target object |
---|
Two HotSwappableTargetSources are equal if the current target objects are equal.
Return a target instance. Invoked immediately before the AOP framework calls the "target" of an AOP method invocation.
Return the type of the current target object.
The returned type should usually be constant across all target objects.
TargetSource
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() |
---|
Swap the target, returning the old target object.
newTarget | the new target object |
---|
IllegalArgumentException | if the new target is invalid |
---|