templth
Aug 30th, 2004, 11:12 AM
Hello,
I see that it's possible to remove an interface from a class with a subclass of DelegatingIntroductionInterceptor and the method suppressInterface.
Is there an exemple in documentation?
I try the following:
-- SuppressInterfaceMixin.java
import org.springframework.aop.support.DelegatingIntroduc tionInterceptor;
import org.aopalliance.intercept.MethodInvocation;
public class SuppressInterfaceMixin extends DelegatingIntroductionInterceptor {
public SuppressInterfaceMixin() {
suppressInterface(Test.class);
}
}
-- applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC
"-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="businesslogicbean" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces">
<value>IBusinessLogic,Test</value>
</property>
<property name="target">
<ref local="beanTarget"/>
</property>
<property name="interceptorNames">
<list>
<value>suppressionAdvisor</value>
</list>
</property>
</bean>
<!-- Bean Classes -->
<bean id="beanTarget" class="BusinessLogic"/>
<bean id="suppressionAdvisor" class="SuppressInterfaceMixin"/>
</beans>
PS: I want to suppress Test interface from BusinessLogic class...
Thanks for your help.
Thierry
I see that it's possible to remove an interface from a class with a subclass of DelegatingIntroductionInterceptor and the method suppressInterface.
Is there an exemple in documentation?
I try the following:
-- SuppressInterfaceMixin.java
import org.springframework.aop.support.DelegatingIntroduc tionInterceptor;
import org.aopalliance.intercept.MethodInvocation;
public class SuppressInterfaceMixin extends DelegatingIntroductionInterceptor {
public SuppressInterfaceMixin() {
suppressInterface(Test.class);
}
}
-- applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC
"-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="businesslogicbean" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces">
<value>IBusinessLogic,Test</value>
</property>
<property name="target">
<ref local="beanTarget"/>
</property>
<property name="interceptorNames">
<list>
<value>suppressionAdvisor</value>
</list>
</property>
</bean>
<!-- Bean Classes -->
<bean id="beanTarget" class="BusinessLogic"/>
<bean id="suppressionAdvisor" class="SuppressInterfaceMixin"/>
</beans>
PS: I want to suppress Test interface from BusinessLogic class...
Thanks for your help.
Thierry