Class HotSwappableTargetSource
java.lang.Object
org.springframework.aop.target.HotSwappableTargetSource
- All Implemented Interfaces:
- Serializable, TargetClassAware, TargetSource
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.
- Author:
- Rod Johnson, Juergen Hoeller
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionHotSwappableTargetSource(Object initialTarget) Create a new HotSwappableTargetSource with the given initial target object.
- 
Method SummaryMethods inherited from interface TargetSourceisStatic, releaseTarget
- 
Constructor Details- 
HotSwappableTargetSourceCreate a new HotSwappableTargetSource with the given initial target object.- Parameters:
- initialTarget- the initial target object
 
 
- 
- 
Method Details- 
getTargetClassReturn the type of the current target object.The returned type should usually be constant across all target objects. - Specified by:
- getTargetClassin interface- TargetClassAware
- Specified by:
- getTargetClassin interface- TargetSource
- Returns:
- the type of targets returned by this TargetSource
 
- 
getTargetDescription copied from interface:TargetSourceReturn a target instance. Invoked immediately before the AOP framework calls the "target" of an AOP method invocation.- Specified by:
- getTargetin interface- TargetSource
- Returns:
- the target object which contains the joinpoint,
or nullif there is no actual target instance
 
- 
swapSwap the target, returning the old target object.- Parameters:
- newTarget- the new target object
- Returns:
- the old target object
- Throws:
- IllegalArgumentException- if the new target is invalid
 
- 
equals
- 
hashCode
- 
toString
 
-