程序包 infra.aop.target
类 HotSwappableTargetSource
java.lang.Object
infra.aop.target.HotSwappableTargetSource
- 所有已实现的接口:
TargetClassAware,TargetSource,Serializable
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 IoC container, use constructor injection.
This TargetSource is serializable if the target is at the time of serialization.
- 从以下版本开始:
- 3.0
- 作者:
- Rod Johnson, Juergen Hoeller, TODAY 2021/2/1 21:26
- 另请参阅:
-
字段概要
字段 -
构造器概要
构造器构造器说明HotSwappableTargetSource(Object initialTarget) Create a new HotSwappableTargetSource with the given initial target object. -
方法概要
修饰符和类型方法说明booleanTwo HotSwappableTargetSources are equal if the current target objects are equal.Return a target instance.Class<?>Return the type of the current target object.inthashCode()final booleanisStatic()Will all calls toTargetSource.getTarget()return the same object?Swap the target, returning the old target object.toString()从接口继承的方法 infra.aop.TargetSource
releaseTarget
-
字段详细资料
-
serialVersionUID
private static final long serialVersionUID- 另请参阅:
-
target
The current target object.
-
-
构造器详细资料
-
HotSwappableTargetSource
Create a new HotSwappableTargetSource with the given initial target object.- 参数:
initialTarget- the initial target object
-
-
方法详细资料
-
getTargetClass
Return the type of the current target object.The returned type should usually be constant across all target objects.
- 指定者:
getTargetClass在接口中TargetClassAware- 指定者:
getTargetClass在接口中TargetSource- 返回:
- the type of targets returned by this
TargetSource
-
isStatic
public final boolean isStatic()从接口复制的说明:TargetSourceWill all calls toTargetSource.getTarget()return the same object?In that case, there will be no need to invoke
TargetSource.releaseTarget(Object), and the AOP framework can cache the return value ofTargetSource.getTarget().The default implementation returns
false.- 指定者:
isStatic在接口中TargetSource- 返回:
trueif the target is immutable- 另请参阅:
-
getTarget
从接口复制的说明:TargetSourceReturn a target instance. Invoked immediately before the AOP framework calls the "target" of an AOP method invocation.- 指定者:
getTarget在接口中TargetSource- 返回:
- the target object which contains the join-point,
or
nullif there is no actual target instance
-
swap
Swap the target, returning the old target object.- 参数:
newTarget- the new target object- 返回:
- the old target object
- 抛出:
IllegalArgumentException- if the new target is invalid
-
equals
Two HotSwappableTargetSources are equal if the current target objects are equal. -
hashCode
public int hashCode() -
toString
-