-
Sep 4th, 2007, 01:17 PM
#1
Intercepting RMI calls
I have a data access class that uses daos for database access (OssImpl) that is exposed for local and remote use implementing two interfaces (OssFacade and OssRmiFacade), the OssRmiFacade is the same as the OssFacade interface except with each method throwing remote exceptions and the whole interface extending java.rmi.Remote.
here's the applicationContext.xml setup:
<bean id="oss" parent="baseMmdbTransactionProxy">
<property name="target">
<bean class="package.OssImpl">
<property .....
</bean>
</property>
</bean>
<bean id="rmiOssExporter" class="org.springframework.remoting.rmi.RmiService Exporter">
<property name="service">
<ref bean="oss"/>
</property>
<property name="serviceName">
<value>oss</value>
</property>
<property name="servicePort">
<value>1090</value>
</property>
<property name="serviceInterface">
<value>package.OssRmiFacade</value>
</property>
<property name="registryPort">
<value>1099</value>
</property>
</bean>
Now, I need to be able to intercept calls *only* when they come from RMI calls. Using a regex pointcut using
<bean id="rmiAdvisor" class="org.springframework.aop.support.RegexpMetho dPointcutAdvisor">
<constructor-arg ref="rmiAdvice"/>
<property name="patterns">
<list>
<value>.*OssRmiFacade.*</value>
</list>
</property>
</bean>
or
<bean id="methodAuthorityAdvisor" class="org.springframework.aop.support.RegexpMetho dPointcutAdvisor">
<constructor-arg ref="methodAuthorityAdvice"/>
<property name="patterns">
<list>
<value>.*OssFacade.*</value>
</list>
</property>
</bean>
both trigger whether the calls is local (using a reference to a OssFacade typed object) or RMI (using a reference to a OssRmiFacade typed object).
Is there a way to distinguish the call as coming from RMI vs a local call?
Trisha
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules