HessianProxyFactory factory = new HessianProxyFactory(executor, host.getName()+":"+host.getPort());
bootstrap.setPipelineFactory(
new RPCClientPipelineFactory(executor, factory));
// Start the connection attempt.
ChannelFuture future = bootstrap.connect(new InetSocketAddress(host.getName(), host.getPort()));
try
{
future.await(10000);
connected = future.isSuccess();
if (connected)
{
Map options = new HashMap();
proxy = (AsyncServiceManagerServer) factory.create(AsyncServiceManagerServer.class, ClientMain.class.getClassLoader(), options);
connected = ((Boolean)((Future)proxy.isServiceManager()).get(10, TimeUnit.SECONDS)).booleanValue();
if (connected)
{
proxies.put(host.getName(), proxy);
Host newHost = new Host(host.getName(), host.getPort());
newHost.setIncluded(host.isIncluded());
newHost.setState("CONNECTED");
hosts.updateObject(newHost);
if (host.isIncluded())
servicesTable.addService(host.getName(), proxy);
}
else
future.getChannel().close();
}
}
catch (Exception e)
{
System.out.println("error accessing "+host.getName());
connected = false;
if (future != null)
future.getChannel().close();
}
}
if (!connected)