I have a system where server communicates with clients via rmi. Client is an initiator, he calls remote server method and delivers all connectivity details to it (name at RMI registry). Then server constructs an RMI stub via the code like below:
At the same time there are some configured aspects at server side. I'd like to advice execution of some methods of MyService interface (for RMI proxies too). It's logical that methods of created RMI stub are not advised now because created RMI proxy is not wrapped by AOP proxies.
RmiProxyFactoryBean factoryBean = new RmiProxyFactoryBean();
MyService service = (MyService) factoryBean.getObject();
// use remote client service
The question is - is it possible to create new RMI proxies and spread AOP existing rules to them?
P.S. I read about ProxyFactory but as far as I see, it allows only from-the-scratch configuring.