|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.aop.target.HotSwappableTargetSource
Implementation of TargetSource interface 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.
Field Summary | |
protected java.lang.Object |
target
Target cached and invoked using reflection |
Constructor Summary | |
HotSwappableTargetSource(java.lang.Object initialTarget)
Create a new HotSwappableTargetSource with the initial target. |
Method Summary | |
boolean |
equals(java.lang.Object other)
Two invoker interceptors are equal if they have the same target or if the targets are equal. |
java.lang.Object |
getTarget()
Synchronization around something that takes so little time is fine |
java.lang.Class |
getTargetClass()
Return the type of targets returned by this TargetSource. |
boolean |
isStatic()
Will all calls to getTarget() return the same object? |
void |
releaseTarget(java.lang.Object o)
Release the given target object obtained from the getTarget() method. |
java.lang.Object |
swap(java.lang.Object newTarget)
Swap the target, returning the old target. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.Object target
Constructor Detail |
public HotSwappableTargetSource(java.lang.Object initialTarget)
initialTarget
- initial targetMethod Detail |
public java.lang.Class getTargetClass()
TargetSource
getTargetClass
in interface TargetSource
public final boolean isStatic()
TargetSource
isStatic
in interface TargetSource
TargetSource.isStatic()
public java.lang.Object getTarget()
getTarget
in interface TargetSource
TargetSource.getTarget()
public void releaseTarget(java.lang.Object o)
TargetSource
releaseTarget
in interface TargetSource
o
- object obtained from a call to getTarget()TargetSource.releaseTarget(java.lang.Object)
public java.lang.Object swap(java.lang.Object newTarget) throws java.lang.IllegalArgumentException
newTarget
- new target
java.lang.IllegalArgumentException
- if the new target is invalidpublic boolean equals(java.lang.Object other)
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |