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