<dependencies>
<!-- JBoss Remoting -->
<dependency>
<groupId>org.jboss.remoting</groupId>
<artifactId>jboss-remoting</artifactId>
<version>3.0.0.Final</version>
</dependency>
<!-- Spring Framework -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.3.4</version>
</dependency>
</dependencies>
public interface UserService {
public User getUser(String username);
}
public class UserServiceImpl implements UserService {
public User getUser(String username) {
}
}
<bean id="userService" class="com.example.UserServiceImpl" />
<bean id="userServiceProxy" class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
<property name="serviceUrl" value="http://localhost:8080/userService" />
<property name="serviceInterface" value="com.example.UserService" />
</bean>
<bean class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
<property name="service" ref="userService" />
<property name="serviceInterface" value="com.example.UserService" />
</bean>
UserService userService = (UserService) context.getBean("userServiceProxy");
User user = userService.getUser("johnDoe");