ClientBootstrap bootstrap = new ClientBootstrap(
new NioClientSocketChannelFactory(
executor,
executor));
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());