public void connectStubs() { for(RouterStub stub : stubs) { try { if(!stub.isConnected()) stub.connect(cluster_name, local_addr, logical_name, phys_addr); } catch (Throwable e) { moveStubToReconnects(stub); } } }
protected void start(String host, int port, String cluster_name, boolean nio) { try { stub=new RouterStub(null, 0, InetAddress.getByName(host), port, nio, null); stub.connect(); stub.getMembers(cluster_name, this); promise.getResult(5000); } catch(Exception ex) { ex.printStackTrace(); stub.destroy(); } }
protected boolean reconnect(Target target) { RouterStub stub=new RouterStub(target.bind_addr, target.router_addr, this.use_nio, this).receiver(target.receiver); if(!add(stub)) return false; try { stub.connect(this.cluster_name, this.local_addr, this.logical_name, this.phys_addr); log.debug("re-established connection to %s successfully for group=%s and address=%s", stub.remote(), this.cluster_name, this.local_addr); return true; } catch(Throwable t) { remove(stub); return false; } }
public void run() { try{ stub.connect(channel_name); }catch(Exception ex){ if(log.isTraceEnabled()) log.trace("failed reconnecting", ex); } } };
public void connectStubs() { for(RouterStub stub : stubs) { try { if(!stub.isConnected()) stub.connect(cluster_name, local_addr, logical_name, phys_addr); } catch (Throwable e) { moveStubToReconnects(stub); } } }
protected void start(String host, int port, String cluster_name, boolean nio) { try { stub=new RouterStub(null, 0, InetAddress.getByName(host), port, nio, null); stub.connect(); stub.getMembers(cluster_name, this); promise.getResult(5000); } catch(Exception ex) { ex.printStackTrace(); stub.destroy(); } }
public Object handleDownEvent(Event evt) { Object retEvent = super.handleDownEvent(evt); switch(evt.getType()){ case Event.CONNECT: try{ stub.connect(channel_name); }catch(Exception e){ if(log.isErrorEnabled()) log.error("failed connecting to GossipRouter at " + router_host + ":" + router_port); } break; case Event.DISCONNECT: teardownTunnel(); break; } return retEvent; }
protected boolean reconnect(Target target) { RouterStub stub=new RouterStub(target.bind_addr, target.router_addr, this.use_nio, this).receiver(target.receiver); if(!add(stub)) return false; try { stub.connect(this.cluster_name, this.local_addr, this.logical_name, this.phys_addr); log.debug("re-established connection to %s successfully for group=%s and address=%s", stub.remote(), this.cluster_name, this.local_addr); return true; } catch(Throwable t) { remove(stub); return false; } }