package devopsdistilled.operp.client.context;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.remoting.rmi.RmiProxyFactoryBean;

import devopsdistilled.operp.server.data.service.items.BrandService;
import devopsdistilled.operp.server.data.service.items.ItemService;
import devopsdistilled.operp.server.data.service.items.ProductService;

@Configuration
public class RmiContext {

	@Bean
	public RmiProxyFactoryBean itemService() {
		RmiProxyFactoryBean rmiProxy = new RmiProxyFactoryBean();
		rmiProxy.setServiceUrl("rmi://127.0.1.1:1099/ItemService");
		rmiProxy.setServiceInterface(ItemService.class);
		return rmiProxy;
	}

	@Bean
	public RmiProxyFactoryBean productService() {
		RmiProxyFactoryBean rmiProxy = new RmiProxyFactoryBean();
		rmiProxy.setServiceUrl("rmi://127.0.1.1:1099/ProductService");
		rmiProxy.setServiceInterface(ProductService.class);
		return rmiProxy;
	}

	@Bean
	public RmiProxyFactoryBean brandService() {
		RmiProxyFactoryBean rmiProxy = new RmiProxyFactoryBean();
		rmiProxy.setServiceUrl("rmi://127.0.1.1:1099/BrandService");
		rmiProxy.setServiceInterface(BrandService.class);
		return rmiProxy;
	}
}

@@ -423,16 +423,84 @@
 ervice;%0A
+import devopsdistilled.operp.server.data.service.stock.StockService;
 %0A@Config
@@ -1286,10 +1286,259 @@
 oxy;%0A%09%7D%0A
+%09@Bean%0A%09public RmiProxyFactoryBean StockService()%7B%0A%09%09RmiProxyFactoryBean rmiProxy=new RmiProxyFactoryBean();%0A%09%09rmiProxy.setServiceUrl(%22rmi://127.0.1.1:1099/StockService%22);%0A%09%09rmiProxy.setServiceInterface(StockService.class);%0A%09%09return rmiProxy;%0A%09%09%0A%09%7D%0A
 %7D%0A

Implement RMI for stock