public static void main(String[] args) throws Exception { String props="udp.xml"; String name=null; boolean nohup=false; for(int i=0; i < args.length; i++) { if(args[i].equals("-props")) { props=args[++i]; continue; } if(args[i].equals("-name")) { name=args[++i]; continue; } if(args[i].equals("-nohup")) { nohup=true; continue; } help(); return; } new Chat().start(props, name, nohup); }
/** 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(); }
public void mouseClicked(MouseEvent e) { Object obj=e.getSource(); if(obj == leaveButton) handleLeave(); else if(obj == sendButton) handleSend(); else if(obj == clearButton) ta.setText(""); }
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 static void main(String[] args) throws Exception { String props="udp.xml"; String name=null; for(int i=0; i < args.length; i++) { if(args[i].equals("-props")) { props=args[++i]; continue; } if(args[i].equals("-name")) { name=args[++i]; continue; } help(); return; } new Chat().start(props, name); }
/** 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(); }
private void start(String props, String name) throws Exception { channel=new JChannel(props); if(name != null) channel.name(name); channel.setReceiver(this); channel.connect("ChatCluster"); eventLoop(); channel.close(); }