I am trying to migrate Spring from XmlApplicationContext to AnnotationConfigApplicationContext (more: Java container configuration ).
Everything works fine, but I donโt know how to create an HttpInvoker client. The XML configuration is as follows:
<bean id="httpInvokerProxy" class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean"> <property name="serviceUrl" value="http://remotehost:8080/remoting/AccountService"/> <property name="serviceInterface" value="example.AccountService"/> </bean>
What should the Java configuration look like? Do I still need this Factory Bean? I think you need to create a client instance without this shell using this configuration method.
This (somehow) is bad for me:
public @Bean AccountService httpInvokerProxy() { HttpInvokerProxyFactoryBean proxy = new HttpInvokerProxyFactoryBean(); proxy.setServiceInterface(AccountService.class); proxy.setServiceUrl("http://remotehost:8080/remoting/AccountService"); proxy.afterPropertiesSet(); return (AccountService) proxy.getObject(); }
java spring spring-remoting
Michaล Minicki
source share