|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A 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.
Method Summary | |
Object |
getTarget()
Return a target instance. |
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 target)
Release the given target object obtained from the getTarget() method. |
Method Detail |
public Class getTargetClass()
public boolean isStatic()
getTarget()
return the same object?
In that case, there will be no need to invoke releaseTarget
,
and the AOP framework can cache the return value of getTarget()
.
getTarget()
public Object getTarget() throws Exception
Exception
- if the target object can't be resolvedpublic void releaseTarget(Object target) throws Exception
getTarget()
method.
target
- object obtained from a call to getTarget()
Exception
- if the object can't be releasedgetTarget()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |