void stop() { if(disp != null) disp.stop(); Util.close(channel); }
public void stop() { if(disp != null) { disp.stop(); disp=null; } Util.close(channel); }
public void start() throws Exception { int c; RspList rsps; channel=new JChannel(); // default props disp=new RpcDispatcher(channel, this).setMembershipListener(this); channel.connect("rpc-test"); while(true) { System.out.println("[x]: exit [s]: send sync group RPC"); System.out.flush(); c=System.in.read(); switch(c) { case 'x': channel.close(); disp.stop(); return; case 's': rsps=sendGroupRpc(); System.out.println("responses:\n" + rsps); break; } System.in.skip(System.in.available()); } }
@ManagedOperation public void stop() { if(l1_cache != null) l1_cache.stop(); if(migrate_data) { List<Address> members_without_me=new ArrayList<>(view.getMembers()); members_without_me.remove(local_addr); for(Map.Entry<K,Cache.Value<V>> entry: l2_cache.entrySet()) { K key=entry.getKey(); Address node=hash_function.hash(key, members_without_me); if(!node.equals(local_addr)) { Cache.Value<V> val=entry.getValue(); sendPut(node, key, val.getValue(), val.getTimeout(), true); if(log.isTraceEnabled()) log.trace("migrated " + key + " from " + local_addr + " to " + node); } } } l2_cache.stop(); disp.stop(); ch.close(); }
disp.stop(); ch.close();
public void stop() { if(channel != null) { channel.close(); disp.stop(); } channel=null; disp=null; }
public void stop() { dispatcher.stop(); executorService.stop(); } }
public void stop() { if(disp != null) { disp.stop(); disp=null; } if(channel != null) { channel.close(); channel=null; } }
public void stop() { if(channel != null) { channel.close(); disp.stop(); } channel=null; disp=null; }
public void stop() { this.asynchHandler.stop(); if (this.dispatcher != null) { this.dispatcher.stop(); } }
public void stop() { if(disp != null) { disp.stop(); disp=null; } if(channel != null) { channel.close(); channel=null; } }
void stop() { if(disp != null) disp.stop(); Util.close(channel); }
public void stop() { if(disp != null) { disp.stop(); disp=null; } Util.close(channel); }
public void channelDisconnected(Channel channel) { stop(); synchronized(additionalChannelListeners) { for(Iterator i = additionalChannelListeners.iterator(); i.hasNext(); ) { ChannelListener l = (ChannelListener)i.next(); try { l.channelDisconnected(channel); } catch(Throwable t) { log.warn("channel listener failed", t); } } } }
public void channelClosed(Channel channel) { stop(); synchronized(additionalChannelListeners) { for(Iterator i = additionalChannelListeners.iterator(); i.hasNext(); ) { ChannelListener l = (ChannelListener)i.next(); try { l.channelClosed(channel); } catch(Throwable t) { log.warn("channel listener failed", t); } } } }
public void stop() { /*lock the queue from other threads*/ synchronized (mutex) { internalQueue.clear(); if (disp != null) { disp.stop(); disp = null; } if (channel != null) { channel.close(); channel = null; } stopped = true; } }
public void start() throws Exception { int c; RspList rsps; channel=new JChannel(); // default props disp=new RpcDispatcher(channel, this).setMembershipListener(this); channel.connect("rpc-test"); while(true) { System.out.println("[x]: exit [s]: send sync group RPC"); System.out.flush(); c=System.in.read(); switch(c) { case 'x': channel.close(); disp.stop(); return; case 's': rsps=sendGroupRpc(); System.out.println("responses:\n" + rsps); break; } System.in.skip(System.in.available()); } }
@ManagedOperation public void stop() { if(l1_cache != null) l1_cache.stop(); if(migrate_data) { List<Address> members_without_me=new ArrayList<>(view.getMembers()); members_without_me.remove(local_addr); for(Map.Entry<K,Cache.Value<V>> entry: l2_cache.entrySet()) { K key=entry.getKey(); Address node=hash_function.hash(key, members_without_me); if(!node.equals(local_addr)) { Cache.Value<V> val=entry.getValue(); sendPut(node, key, val.getValue(), val.getTimeout(), true); if(log.isTraceEnabled()) log.trace("migrated " + key + " from " + local_addr + " to " + node); } } } l2_cache.stop(); disp.stop(); ch.close(); }
disp.stop(); ch.close();