org.springframework.aop.framework.Advised |
Known Indirect Subclasses |
Interface to be implemented by classes that hold the configuration of a factory of AOP proxies. This configuration includes the Interceptors and other advice, and Advisors, and the proxied interfaces.
Any AOP proxy obtained from Spring can be cast to this interface to allow manipulation of its AOP advice.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Add the given AOP Alliance Advice at the specified position in the advice chain.
| |||||||||||
Add the given AOP Alliance advice to the tail of the advice (interceptor) chain.
| |||||||||||
Add an advisor at the end of the advisor chain.
| |||||||||||
Add an Advisor at the specified position in the chain.
| |||||||||||
Return the advisors applying to this proxy.
| |||||||||||
Return the interfaces proxied by the AOP proxy.
| |||||||||||
Return the TargetSource used by this Advised object.
| |||||||||||
Return the index (from 0) of the given advisor,
or -1 if no such advisor applies to this proxy.
| |||||||||||
Return the index (from 0) of the given AOP Alliance Advice,
or -1 if no such advice is an advice for this proxy.
| |||||||||||
Return whether the factory should expose the proxy as a ThreadLocal.
| |||||||||||
Return whether the Advised configuration is frozen,
in which case no advice changes can be made.
| |||||||||||
Determine whether the given interface is proxied.
| |||||||||||
Return whether this proxy configuration is pre-filtered so that it only
contains applicable advisors (matching this proxy's target class).
| |||||||||||
Are we proxying the full target class instead of specified interfaces?
| |||||||||||
Remove the Advisor containing the given advice.
| |||||||||||
Remove the advisor at the given index.
| |||||||||||
Remove the given advisor.
| |||||||||||
Replace the given advisor.
| |||||||||||
Set whether the proxy should be exposed by the AOP framework as a
ThreadLocal for retrieval via the AopContext class.
| |||||||||||
Set whether this proxy configuration is pre-filtered so that it only
contains applicable advisors (matching this proxy's target class).
| |||||||||||
Change the TargetSource used by this Advised object.
| |||||||||||
As
toString() will normally be delegated to the target,
this returns the equivalent for the AOP proxy. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
org.springframework.aop.TargetClassAware
|
Add the given AOP Alliance Advice at the specified position in the advice chain.
This will be wrapped in a DefaultPointcutAdvisor
with a pointcut that always applies, and returned from the getAdvisors()
method in this wrapped form.
Note: The given advice will apply to all invocations on the proxy,
even to the toString()
method! Use appropriate advice implementations
or specify appropriate pointcuts to apply to a narrower set of methods.
pos | index from 0 (head) |
---|---|
advice | advice to add at the specified position in the advice chain |
AopConfigException | in case of invalid advice |
---|
Add the given AOP Alliance advice to the tail of the advice (interceptor) chain.
This will be wrapped in a DefaultPointcutAdvisor with a pointcut that always
applies, and returned from the getAdvisors()
method in this wrapped form.
Note that the given advice will apply to all invocations on the proxy,
even to the toString()
method! Use appropriate advice implementations
or specify appropriate pointcuts to apply to a narrower set of methods.
advice | advice to add to the tail of the chain |
---|
AopConfigException | in case of invalid advice |
---|
Add an advisor at the end of the advisor chain.
The Advisor may be an IntroductionAdvisor
,
in which new interfaces will be available when a proxy is next obtained
from the relevant factory.
advisor | the advisor to add to the end of the chain |
---|
AopConfigException | in case of invalid advice |
---|
Add an Advisor at the specified position in the chain.
pos | position in chain (0 is head). Must be valid. |
---|---|
advisor | the advisor to add at the specified position in the chain |
AopConfigException | in case of invalid advice |
---|
Return the advisors applying to this proxy.
null
)
Return the interfaces proxied by the AOP proxy. Will not include the target class, which may also be proxied.
Return the TargetSource used by this Advised object.
Return the index (from 0) of the given advisor, or -1 if no such advisor applies to this proxy.
The return value of this method can be used to index into the advisors array.
advisor | the advisor to search for |
---|
Return the index (from 0) of the given AOP Alliance Advice, or -1 if no such advice is an advice for this proxy.
The return value of this method can be used to index into the advisors array.
advice | AOP Alliance advice to search for |
---|
Return whether the factory should expose the proxy as a ThreadLocal.
This can be necessary if a target object needs to invoke a method on itself
benefitting from advice. (If it invokes a method on this
no advice
will apply.) Getting the proxy is analogous to an EJB calling getEJBObject().
Return whether the Advised configuration is frozen, in which case no advice changes can be made.
Determine whether the given interface is proxied.
intf | the interface to check |
---|
Return whether this proxy configuration is pre-filtered so that it only contains applicable advisors (matching this proxy's target class).
Are we proxying the full target class instead of specified interfaces?
Remove the Advisor containing the given advice.
advice | the advice to remove |
---|
true
of the advice was found and removed;
false
if there was no such advice
Remove the advisor at the given index.
index | index of advisor to remove |
---|
AopConfigException | if the index is invalid |
---|
Remove the given advisor.
advisor | the advisor to remove |
---|
true
if the advisor was removed; false
if the advisor was not found and hence could not be removed
Replace the given advisor.
Note: If the advisor is an IntroductionAdvisor
and the replacement is not or implements different interfaces, the proxy will need
to be re-obtained or the old interfaces won't be supported and the new interface
won't be implemented.
a | the advisor to replace |
---|---|
b | the advisor to replace it with |
false
and does nothing.AopConfigException | in case of invalid advice |
---|
Set whether the proxy should be exposed by the AOP framework as a
ThreadLocal for retrieval via the AopContext class. This is useful
if an advised object needs to call another advised method on itself.
(If it uses this
, the invocation will not be advised).
Default is "false", for optimal performance.
Set whether this proxy configuration is pre-filtered so that it only contains applicable advisors (matching this proxy's target class).
Default is "false". Set this to "true" if the advisors have been pre-filtered already, meaning that the ClassFilter check can be skipped when building the actual advisor chain for proxy invocations.
Change the TargetSource used by this Advised object. Only works if the configuration isn't frozen.
targetSource | new TargetSource to use |
---|
As toString()
will normally be delegated to the target,
this returns the equivalent for the AOP proxy.