程序包 infra.aop.target
类 SingletonTargetSource
java.lang.Object
infra.aop.target.SingletonTargetSource
- 所有已实现的接口:
TargetClassAware,TargetSource,Serializable
Implementation of the
TargetSource interface
that holds a given object. This is the default implementation of the TargetSource
interface, as used by the 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.
- 作者:
- Rod Johnson, Juergen Hoeller, TODAY 2021/2/1 20:18
- 另请参阅:
-
字段概要
字段修饰符和类型字段说明private static final longprivate final ObjectTarget cached and invoked using reflection. -
构造器概要
构造器构造器说明SingletonTargetSource(Object target) Create a new SingletonTargetSource for the given target. -
方法概要
修饰符和类型方法说明booleanTwo invoker interceptors are equal if they have the same target or if the targets or the targets are equal.Return a target instance.Class<?>Return the type of targets returned by thisTargetSource.inthashCode()SingletonTargetSource uses the hash code of the target object.booleanisStatic()Will all calls toTargetSource.getTarget()return the same object?voidreleaseTarget(Object target) Release the given target object obtained from theTargetSource.getTarget()method, if any.toString()
-
字段详细资料
-
serialVersionUID
private static final long serialVersionUID- 另请参阅:
-
target
Target cached and invoked using reflection.
-
-
构造器详细资料
-
SingletonTargetSource
Create a new SingletonTargetSource for the given target.- 参数:
target- the target object
-
-
方法详细资料
-
getTargetClass
从接口复制的说明:TargetSourceReturn the type of targets returned by thisTargetSource.Can return
null, although certain usages of aTargetSourcemight just work with a predetermined target class.- 指定者:
getTargetClass在接口中TargetClassAware- 指定者:
getTargetClass在接口中TargetSource- 返回:
- the type of targets returned by this
TargetSource
-
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
-
releaseTarget
从接口复制的说明:TargetSourceRelease the given target object obtained from theTargetSource.getTarget()method, if any.The default implementation is empty.
- 指定者:
releaseTarget在接口中TargetSource- 参数:
target- object obtained from a call toTargetSource.getTarget()
-
isStatic
public 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- 另请参阅:
-
equals
Two invoker interceptors are equal if they have the same target or if the targets or the targets are equal. -
hashCode
public int hashCode()SingletonTargetSource uses the hash code of the target object. -
toString
-