// Service exposed as WS
_resteasyInbound = new InboundHandler(_config, _domain);
_resteasyInbound.start();
RESTEasyBindingModel config = new V1RESTEasyBindingModel(RESTEasyNamespace.DEFAULT.uri()) {
@Override
public CompositeReferenceModel getReference() {
return new V1CompositeReferenceModel();
}
};
config.setServiceName(_proxyConsumerService1.getServiceName());
config.setName("proxy-test");
config.setInterfaces("org.switchyard.component.resteasy.HelloResource");
config.setAddress("http://unreachablehost");
// Service consumer or Reference binding
_resteasyProxyOutbound1 = new OutboundHandler(config, null);
_resteasyProxyOutbound1.start();
_domain.registerService(_proxyConsumerService1.getServiceName(), new HelloRESTEasyInterface(), _resteasyProxyOutbound1);
ProxyModel proxy = new V1ProxyModel(RESTEasyNamespace.DEFAULT.uri());
proxy.setHost(host);
proxy.setPort("" + PROXYPORT);
config.setAddress("http://" + host + ":" + port);
config.setProxyConfig(proxy);
config.setServiceName(_proxyConsumerService2.getServiceName());
// Service consumer or Reference binding
_resteasyProxyOutbound2 = new OutboundHandler(config, null);
_resteasyProxyOutbound2.start();
_domain.registerService(_proxyConsumerService2.getServiceName(), new HelloRESTEasyInterface(), _resteasyProxyOutbound2);
proxy.setUser(PROXY_USER);
proxy.setPassword(PROXY_PWD);
config.setProxyConfig(proxy);
config.setServiceName(_proxyConsumerService3.getServiceName());
// Service consumer or Reference binding
_resteasyProxyOutbound3 = new OutboundHandler(config, null);
_resteasyProxyOutbound3.start();
_domain.registerService(_proxyConsumerService3.getServiceName(), new HelloRESTEasyInterface(), _resteasyProxyOutbound3);