use of com.predic8.wsdl.Port in project service-proxy by membrane.
the class LBNotificationClient method run.
public void run(String[] args) throws Exception {
CommandLine cl = new DefaultParser().parse(getOptions(), args, false);
if (cl.hasOption('h') || args.length < 2) {
printUsage();
return;
}
parseArguments(cl);
logArguments();
Response res = notifiyClusterManager();
if (res.getStatusCode() != 204) {
throw new Exception("Got StatusCode: " + res.getStatusCode());
}
log.info("Sent " + cmd + " message to " + host + ":" + port + (skeySpec != null ? " encrypted" : ""));
}
use of com.predic8.wsdl.Port in project service-proxy by membrane.
the class EtcdBasedConfigurator method shutdownRunningClusterNode.
private void shutdownRunningClusterNode(EtcdNodeInformation node) {
log.info("Destroying " + node);
ServiceProxy sp = runningServiceProxyForModule.get(node.getModule());
LoadBalancingInterceptor lbi = (LoadBalancingInterceptor) sp.getInterceptors().get(0);
lbi.getClusterManager().removeNode(Balancer.DEFAULT_NAME, baseUrl, port);
runningNodesForModule.get(node.getModule()).remove(node);
}
use of com.predic8.wsdl.Port in project service-proxy by membrane.
the class EtcdBasedConfigurator method setUpModuleServiceProxy.
private ServiceProxy setUpModuleServiceProxy(String name, int port, String path) {
log.info("Creating serviceProxy for module: " + path);
ServiceProxyKey key = new ServiceProxyKey("*", "*", path, port);
key.setUsePathPattern(true);
key.setPathRegExp(false);
ServiceProxy sp = new ServiceProxy(key, null, 0);
sp.getInterceptors().add(new LoadBalancingInterceptor());
try {
sp.init(router);
router.add(sp);
runningServiceProxyForModule.put(path, sp);
} catch (Exception ignored) {
}
return sp;
}
use of com.predic8.wsdl.Port in project service-proxy by membrane.
the class MultipleLoadBalancersTest method createBalancingInterceptor.
private LoadBalancingInterceptor createBalancingInterceptor(int port, String name) throws Exception {
ServiceProxy sp3 = new ServiceProxy(new ServiceProxyKey("localhost", "POST", ".*", port), "thomas-bayer.com", 80);
LoadBalancingInterceptor balancingInterceptor1 = new LoadBalancingInterceptor();
balancingInterceptor1.setName(name);
sp3.getInterceptors().add(balancingInterceptor1);
balancer.getRuleManager().addProxyAndOpenPortIfNew(sp3);
balancer.init();
return balancingInterceptor1;
}
use of com.predic8.wsdl.Port in project service-proxy by membrane.
the class WSDLPublisherTest method before.
@Before
public void before() throws Exception {
router = new HttpRouter();
ServiceProxy sp2 = new ServiceProxy(new ServiceProxyKey("*", "*", ".*", port), "", -1);
WSDLPublisherInterceptor wi = new WSDLPublisherInterceptor();
wi.setWsdl(wsdlLocation);
wi.init(router);
sp2.getInterceptors().add(wi);
router.getRuleManager().addProxyAndOpenPortIfNew(sp2);
router.init();
}
Aggregations