org.springframework.aop.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.
| Modifier and Type | Field and Description |
|---|---|
| private static final long | serialVersionUID
use serialVersionUID from Spring 1.2 for interoperability. |
| private Object | target
The current target object. |
| Access | Constructor and Description |
|---|---|
| public | HotSwappableTargetSource(Object
the initial target object initialTarget)Create a new HotSwappableTargetSource with the given initial target object. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. |
| public synchronized Object | |
| public synchronized Class | getTargetClass()
Implements org. |
| public int | |
| public synchronized Object | |
| public String |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID use serialVersionUID from Spring 1.2 for interoperability. | |
| target | back to summary |
|---|---|
| private Object target The current target object.
| |
| HotSwappableTargetSource | back to summary |
|---|---|
| public HotSwappableTargetSource(Object initialTarget) Create a new HotSwappableTargetSource with the given initial target object.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Two HotSwappableTargetSources are equal if the current target objects are equal.
| |
| getTarget | back to summary |
|---|---|
| public synchronized Object getTarget() Implements org. Doc from org. Return a target instance. Invoked immediately before the AOP framework calls the "target" of an AOP method invocation. | |
| getTargetClass | back to summary |
|---|---|
| public synchronized Class Implements org. Return the type of the current target object. The returned type should usually be constant across all target objects.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| swap | back to summary |
|---|---|
| public synchronized Object swap(Object newTarget) throws IllegalArgumentException Swap the target, returning the old target object.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |