我有一个这样的bean定义:
<bean id="myService" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
<property name="serviceInterface" value="org.myapp.MyService"/>
<property name="serviceUrl" value="rmi://localhost:1099/myService"/>
</bean>
我这样获取服务bean:
我这样获取服务bean:
ApplicationContext context = new ClassPathXmlApplicationContext("classpath:rmi-client-config.xml");
MyService myService = context.getBean("myService", MyService.class);
当然,它返回"MyService" impl的实例,而不是RmiProxyFactoryBean。那么我如何使用上面的xml定义来更改"serviceUrl"参数,而不是手动实例化RmiProxyFactoryBean呢?
RmiProxyFactoryBean
是最好的选择。 - skaffman