|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.springframework.aop.framework.ProxyConfig
org.springframework.aop.framework.AdvisedSupport
Superclass for AOP Proxy configuration managers. These are not themselves AOP proxies, but subclasses of this class are normally factories from which AOP proxy instances are obtained directly.
This class frees subclasses of the housekeeping of Interceptors and Advisors, but doesn't actually implement proxy creation methods, which are provided by subclasses.
AopProxy| Field Summary | |
static TargetSource |
EMPTY_TARGET_SOURCE
Canonical TargetSource when there's no target, and behavior is supplied by the advisors. |
| Fields inherited from class org.springframework.aop.framework.ProxyConfig |
exposeProxy, logger |
| Constructor Summary | |
AdvisedSupport()
No arg constructor to allow use as a JavaBean. |
|
AdvisedSupport(java.lang.Class[] interfaces)
Create a DefaultProxyConfig with the given parameters. |
|
| Method Summary | |
void |
addAdvisor(Advisor advice)
Add an Advisor at the end of the advisor chain. |
void |
addAdvisor(int pos,
Advisor advisor)
Add an Advisor at the specified position in the chain |
void |
addAdvisor(int pos,
IntroductionAdvisor advisor)
|
void |
addAfterReturningAdvice(AfterReturningAdvice ara)
Add an AfterReturningAdvice to the tail of the advice chain |
void |
addBeforeAdvice(MethodBeforeAdvice ba)
Add a MethodBeforeAdvice to the tail of the advice chain |
void |
addInterceptor(org.aopalliance.intercept.Interceptor interceptor)
Add the given AOP Alliance interceptor to the tail of the advice (interceptor) chain. |
void |
addInterceptor(int pos,
org.aopalliance.intercept.Interceptor interceptor)
Cannot add IntroductionInterceptors this way. |
void |
addInterface(java.lang.Class newInterface)
Add a new proxied interface. |
void |
addListener(AdvisedSupportListener listener)
|
void |
addThrowsAdvice(ThrowsAdvice throwsAdvice)
Add a ThrowsAdvice to the tail of the advice chain |
protected void |
copyConfigurationFrom(AdvisedSupport other)
Call this method on a new instance created by the no-arg constructor to create an independent copy of the configuration from the other. |
int |
countInterceptorsOfType(java.lang.Class interceptorClass)
Count interceptors of the given class |
protected AopProxy |
createAopProxy()
Subclasses should call this to get a new AOP proxy. |
AdvisorChainFactory |
getAdvisorChainFactory()
|
Advisor[] |
getAdvisors()
Return the Advisors applying to this proxy. |
java.lang.Class[] |
getProxiedInterfaces()
Return the interfaces proxied by the AOP proxy. |
TargetSource |
getTargetSource()
Return the TargetSource used by this Advised object |
int |
indexOf(Advisor advisor)
Return the index (from 0) of the given advisor, or -1 if no such advisor applies to this proxy. |
int |
indexOf(org.aopalliance.intercept.Interceptor interceptor)
Return the index (from 0) of the given AOP Alliance interceptor, or -1 if no such interceptor is an advice for this proxy. |
boolean |
interceptorIncluded(org.aopalliance.intercept.Interceptor mi)
Is this interceptor included in any advisor? |
protected boolean |
isActive()
Subclasses can call this to check whether any AOP proxies have been created yet. |
boolean |
isInterfaceProxied(java.lang.Class intf)
Return whether this interface is proxied |
boolean |
removeAdvisor(Advisor advisor)
Remove the given advisor |
void |
removeAdvisor(int index)
Remove the advisor at the given index |
boolean |
removeInterceptor(org.aopalliance.intercept.Interceptor interceptor)
Convenience method to remove an interceptor. |
boolean |
removeInterface(java.lang.Class intf)
Remove a proxied interface. |
void |
removeListener(AdvisedSupportListener listener)
|
boolean |
replaceAdvisor(Advisor a,
Advisor b)
Replace the given advisor. |
void |
setAdvisorChainFactory(AdvisorChainFactory advisorChainFactory)
|
void |
setInterfaces(java.lang.Class[] interfaces)
Set the interfaces to be proxied. |
void |
setTarget(java.lang.Object target)
|
void |
setTargetSource(TargetSource targetSource)
|
java.lang.String |
toProxyConfigString()
As toString() will normally pass to the target, this returns the equivalent for the AOP proxy |
java.lang.String |
toString()
For debugging/diagnostic use. |
| Methods inherited from class org.springframework.aop.framework.ProxyConfig |
copyFrom, getAopProxyFactory, getExposeProxy, getOptimize, getProxyTargetClass, isFrozen, setAopProxyFactory, setExposeProxy, setFrozen, setOptimize, setProxyTargetClass |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.springframework.aop.framework.Advised |
getExposeProxy, getProxyTargetClass, isFrozen |
| Field Detail |
public static final TargetSource EMPTY_TARGET_SOURCE
| Constructor Detail |
public AdvisedSupport()
public AdvisedSupport(java.lang.Class[] interfaces)
interfaces - the proxied interfaces| Method Detail |
public void addListener(AdvisedSupportListener listener)
public void removeListener(AdvisedSupportListener listener)
public void setTarget(java.lang.Object target)
public void setTargetSource(TargetSource targetSource)
public TargetSource getTargetSource()
Advised
getTargetSource in interface Advisedpublic void setAdvisorChainFactory(AdvisorChainFactory advisorChainFactory)
public AdvisorChainFactory getAdvisorChainFactory()
protected void copyConfigurationFrom(AdvisedSupport other)
Does not copy MethodInvocationFactory; a parameter should be provided to the constructor if necessary. Note that the same MethodInvocationFactory should not be used for the new instance, or it may not be independent.
other - DefaultProxyConfig to copy configuration frompublic void setInterfaces(java.lang.Class[] interfaces)
public void addInterface(java.lang.Class newInterface)
newInterface - additional interface to proxypublic java.lang.Class[] getProxiedInterfaces()
Advised
getProxiedInterfaces in interface Advisedpublic boolean removeInterface(java.lang.Class intf)
public void addInterceptor(org.aopalliance.intercept.Interceptor interceptor)
throws AopConfigException
Advised
addInterceptor in interface Advisedinterceptor - to add to the tail of the chain
AopConfigExceptionAdvised.addInterceptor(int, Interceptor),
DefaultPointcutAdvisorpublic boolean isInterfaceProxied(java.lang.Class intf)
Advised
isInterfaceProxied in interface Advisedintf - interface to test
public void addInterceptor(int pos,
org.aopalliance.intercept.Interceptor interceptor)
throws AopConfigException
addInterceptor in interface Advisedpos - index from 0 (head)interceptor - interceptor to add at the specified position in the
interceptor chain
AopConfigException
public final boolean removeInterceptor(org.aopalliance.intercept.Interceptor interceptor)
throws AopConfigException
AopConfigException
public void addAfterReturningAdvice(AfterReturningAdvice ara)
throws AopConfigException
Advised
addAfterReturningAdvice in interface Advisedara - AfterReturningAdvice to add
AopConfigException - if the advice cannot be added--for example, because
the proxy configuration is frozen
public void addBeforeAdvice(MethodBeforeAdvice ba)
throws AopConfigException
Advised
addBeforeAdvice in interface Advisedba - MethodBeforeAdvice to add
AopConfigException - if the advice cannot be added--for example, because
the proxy configuration is frozen
public void addThrowsAdvice(ThrowsAdvice throwsAdvice)
throws AopConfigException
Advised
addThrowsAdvice in interface AdvisedthrowsAdvice - ThrowsAdvice to add
AopConfigException - if the advice cannot be added--for example, because
the proxy configuration is frozenpublic int indexOf(org.aopalliance.intercept.Interceptor interceptor)
interceptor - AOP Alliance interceptor to search for
public int indexOf(Advisor advisor)
indexOf in interface Advisedadvisor - advisor to search for
public final boolean removeAdvisor(Advisor advisor)
Advised
removeAdvisor in interface Advisedadvisor - advisor to remove
public void removeAdvisor(int index)
throws AopConfigException
Advised
removeAdvisor in interface Advisedindex - index of advisor to remove
AopConfigException - if the index is invalid
public void addAdvisor(int pos,
IntroductionAdvisor advisor)
throws AopConfigException
AopConfigException
public void addAdvisor(int pos,
Advisor advisor)
throws AopConfigException
Advised
addAdvisor in interface Advisedadvisor - advisor to add at the specified position in the chainpos - position in chain (0 is head). Must be valid.
AopConfigExceptionpublic void addAdvisor(Advisor advice)
Advised
addAdvisor in interface Advisedadvice - Advisor to add to the end of the chainpublic final Advisor[] getAdvisors()
Advised
getAdvisors in interface Advised
public final boolean replaceAdvisor(Advisor a,
Advisor b)
throws AopConfigException
replaceAdvisor in interface Adviseda - advisor to replaceb - advisor to replace it with
AopConfigExceptionpublic final boolean interceptorIncluded(org.aopalliance.intercept.Interceptor mi)
mi - interceptor to check inclusion of
public final int countInterceptorsOfType(java.lang.Class interceptorClass)
interceptorClass - class of the interceptor to check
protected AopProxy createAopProxy()
protected final boolean isActive()
public java.lang.String toProxyConfigString()
Advised
toProxyConfigString in interface Advisedpublic java.lang.String toString()
toString in class ProxyConfig
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||