|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 | |
protected AdvisorChainFactory |
advisorChainFactory
|
static TargetSource |
EMPTY_TARGET_SOURCE
Canonical TargetSource when there's no target, and behaviour is supplied by the advisors. |
protected TargetSource |
targetSource
|
Fields inherited from class org.springframework.aop.framework.ProxyConfig |
exposeProxy, logger |
Constructor Summary | |
AdvisedSupport()
No arg constructor to allow use as a Java bean. |
|
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 |
addBeforeAdvice(MethodBeforeAdvice ba)
|
void |
addInterceptor(org.aopalliance.intercept.Interceptor interceptor)
Add the given 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 l)
|
void |
addThrowsAdvice(ThrowsAdvice throwsAdvice)
|
protected void |
copyConfigurationFrom(AdvisedSupport other)
Call this method on a new instance created by the no-arg consructor 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()
Return the AdvisorChainFactory associated with this ProxyConfig. |
Advisor[] |
getAdvisors()
Return the Advisors applying to this proxy. |
MethodInvocationFactory |
getMethodInvocationFactory()
|
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 l)
|
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 |
setMethodInvocationFactory(MethodInvocationFactory methodInvocationFactory)
|
void |
setTarget(java.lang.Object target)
|
void |
setTargetSource(TargetSource ts)
|
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 TargetSource EMPTY_TARGET_SOURCE
protected TargetSource targetSource
protected AdvisorChainFactory advisorChainFactory
Constructor Detail |
public AdvisedSupport()
public AdvisedSupport(java.lang.Class[] interfaces)
interfaces
- the proxied interfacesMethod Detail |
public void addListener(AdvisedSupportListener l)
public void removeListener(AdvisedSupportListener l)
public void setTargetSource(TargetSource ts)
public void setTarget(java.lang.Object target)
public final TargetSource getTargetSource()
Advised
getTargetSource
in interface Advised
public void setAdvisorChainFactory(AdvisorChainFactory advisorChainFactory)
public final AdvisorChainFactory getAdvisorChainFactory()
public final MethodInvocationFactory getMethodInvocationFactory()
public void setMethodInvocationFactory(MethodInvocationFactory methodInvocationFactory)
methodInvocationFactory
- The methodInvocationFactory to set.protected void copyConfigurationFrom(AdvisedSupport other)
other
- DefaultProxyConfig to copy configuration frompublic void addInterceptor(org.aopalliance.intercept.Interceptor interceptor) throws AopConfigException
Advised
addInterceptor
in interface Advised
interceptor
- to add to the tail of the chain
AopConfigException
Advised.addInterceptor(int, Interceptor)
public boolean isInterfaceProxied(java.lang.Class intf)
Advised
isInterfaceProxied
in interface Advised
intf
- interface to test
public void addInterceptor(int pos, org.aopalliance.intercept.Interceptor interceptor) throws AopConfigException
addInterceptor
in interface Advised
pos
- index from 0 (head)interceptor
- interceptor to add at the specified position in the
interceptor chain
AopConfigException
public void addBeforeAdvice(MethodBeforeAdvice ba) throws AopConfigException
AopConfigException
public void addThrowsAdvice(ThrowsAdvice throwsAdvice) throws AopConfigException
AopConfigException
public int indexOf(org.aopalliance.intercept.Interceptor interceptor)
interceptor
- AOP Alliance interceptor to search for
public int indexOf(Advisor advisor)
indexOf
in interface Advised
advisor
- advisor to search for
public final boolean removeAdvisor(Advisor advisor)
Advised
removeAdvisor
in interface Advised
advisor
- advisor to remove
public void removeAdvisor(int index) throws AopConfigException
Advised
removeAdvisor
in interface Advised
index
- index of advisor to remove
AopConfigException
- if the index is invalidpublic final boolean removeInterceptor(org.aopalliance.intercept.Interceptor interceptor) throws AopConfigException
AopConfigException
public void setInterfaces(java.lang.Class[] interfaces)
interfaces
- the interfaces to setpublic void addInterface(java.lang.Class newInterface)
newInterface
- additional interface to proxypublic boolean removeInterface(java.lang.Class intf)
public final java.lang.Class[] getProxiedInterfaces()
Advised
getProxiedInterfaces
in interface Advised
public void addAdvisor(int pos, IntroductionAdvisor advisor) throws AopConfigException
AopConfigException
public void addAdvisor(int pos, Advisor advisor) throws AopConfigException
Advised
addAdvisor
in interface Advised
advisor
- advisor to add at the specified position in the chainpos
- position in chain (0 is head). Must be valid.
AopConfigException
public void addAdvisor(Advisor advice)
Advised
addAdvisor
in interface Advised
advice
- 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 Advised
a
- advisor to replaceb
- advisor to replace it with
AopConfigException
public 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 Advised
public java.lang.String toString()
toString
in class ProxyConfig
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |