spring-framework / org.springframework.aop.target / HotSwappableTargetSource

HotSwappableTargetSource

open class HotSwappableTargetSource : TargetSource, Serializable

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.

Author
Rod Johnson

Author
Juergen Hoeller

Constructors

<init>

HotSwappableTargetSource(initialTarget: Any)

Create a new HotSwappableTargetSource with the given initial target object.

Functions

equals

open fun equals(other: Any?): Boolean

Two HotSwappableTargetSources are equal if the current target objects are equal.

getTarget

open fun getTarget(): Any

getTargetClass

open fun getTargetClass(): Class<*>

Return the type of the current target object.

The returned type should usually be constant across all target objects.

hashCode

open fun hashCode(): Int

isStatic

fun isStatic(): Boolean

releaseTarget

open fun releaseTarget(target: Any): Unit

swap

open fun swap(newTarget: Any): Any

Swap the target, returning the old target object.

toString

open fun toString(): String