TargetSource is used to obtain the current "target" of
an AOP invocation, which will be invoked via reflection if no around
advice chooses to end the interceptor chain itself.
If a TargetSource is "static", it will always return
the same target, allowing optimizations in the AOP framework. Dynamic
target sources can support pooling, hot swapping, etc.
Application developers don't usually need to work with
TargetSources directly: this is an AOP framework interface.
| Modifier and Type | Method and Description |
|---|---|
| public Object | Returns: the target object which contains the joinpoint, ornull if there is no actual target instanceReturn a target instance. |
| public Class | Returns: the type of targets returned by thisTargetSourceRedeclares org. Return the type of targets returned by this |
| public default boolean | Returns: true if the target is immutableWill all calls to |
| public default void | releaseTarget(Object
object obtained from a call to target)getTarget()Release the given target object obtained from the
|
| getTarget | back to summary |
|---|---|
| public Object getTarget() throws Exception Return a target instance. Invoked immediately before the AOP framework calls the "target" of an AOP method invocation. | |
| getTargetClass | back to summary |
|---|---|
| public Class Redeclares org. Return the type of targets returned by this Can return
| |
| isStatic | back to summary |
|---|---|
| public default boolean isStatic() Will all calls to In that case, there will be no need to invoke The default implementation returns
| |
| releaseTarget | back to summary |
|---|---|
| public default void releaseTarget(Object target) throws Exception Release the given target object obtained from the
The default implementation is empty.
| |