/** * Destroys the channel and its associated resources (e.g., the protocol stack). After a channel * has been closed, invoking methods on it throws the <code>ChannelClosed</code> exception (or * results in a null operation). It is a null operation if the channel is already closed. * <p> * If the channel is connected to a group, <code>disconnect()</code> will be called first. */ public void close() { ch.close(); }
public void closeJChannel() { System.out.println("Close channel"); jChannel.close(); }
public void stop() { if(!no_channel) { try { channel.close(); } catch(Exception ex) { System.err.println(ex); } } mainFrame.setVisible(false); mainFrame.dispose(); }
public synchronized void closeChannel() { connected = false; channel.setReceiver(null); if (logger.isTraceEnabled()) { logger.trace(this + "::Closing Channel: " + channelName, new Exception("Trace")); } channel.close(); }
@Override public void close() { if (channel != null && !channel.isClosed()) { channel.close(); } }
public void destroy() { System.out.println("------- DESTROY"); showStatus("Disconnecting from " + groupname); channel.close(); showStatus("Disconnected"); }
public void windowClosing(WindowEvent e) { setVisible(false); dispose(); channel.close(); }
/** Method called from other app, injecting channel */ public void start(JChannel ch) throws Exception { channel=ch; channel.setReceiver(this); channel.connect("ChatCluster"); eventLoop(); channel.close(); }
@Override public void accept(JChannel channel) { channel.disconnect(); if (this.server != null) { try { JmxConfigurator.unregisterChannel(channel, this.server.get(), this.name); } catch (Exception e) { JGroupsLogger.ROOT_LOGGER.debug(e.getLocalizedMessage(), e); } } channel.close(); } }
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()); } }
public void destroy() { if (disp != null) { try { MethodCall call = new MethodCall("removeNode", new Object[] {panel.my_addr}, new Class[] {Object.class}); disp.callRemoteMethods(null, call, new RequestOptions(ResponseMode.GET_ALL, 5000)); } catch (Exception e) { log.error(e.toString()); } channel.close(); disp = null; if (panel != null) { panel.stop(); panel = null; } } }
@Override public void stop() { if (localAddress != null && localAddress.getVmViewId() >= 0) { // keep track of old addresses that were used to successfully join the cluster usedDistributedMemberIdentifiers.add(localAddress); } if (this.myChannel != null) { if ((services.isShutdownDueToForcedDisconnect() && services.isAutoReconnectEnabled()) || services.getManager().isReconnectingDS()) { // leave the channel open for reconnect attempts } else { this.myChannel.close(); } } }
break; case 'q': channel.close(); return; default:
private void start(String props, String name, boolean nohup) throws Exception { channel=new JChannel(props); if(name != null) channel.name(name); channel.setReceiver(this); channel.connect("ChatCluster"); if(!nohup) { eventLoop(); channel.close(); } }
public void start() throws Exception { channel=new JChannel(props); disp=new MessageDispatcher(channel, this).setMembershipListener(this); channel.connect("MessageDispatcherSpeedTestGroup"); try { if(server) { System.out.println("-- Started as server. Press ctrl-c to kill"); while(true) { Util.sleep(10000); } } else { sendMessages(num); } } catch(Throwable t) { t.printStackTrace(System.err); } finally { channel.close(); disp.stop(); } }
@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(); }
break; case 'q': channel.close(); return; default:
l2_cache.stop(); disp.stop(); ch.close();
case "Quit": setVisible(false); channel.close(); System.exit(0); default:
myChannel.close(); throw new SystemConnectException("unable to create jgroups channel", e);