log.error(ex);
System.err.println(ex);
    public static void main(String[] args) {        Vector gossip_hosts=new Vector();        String host;        InetAddress ip_addr;        int port;        boolean get=false, register=false, keep_running=false;        String register_host=null;        int register_port=0;        String get_group=null, register_group=null;        GossipClient gossip_client=null;        Vector mbrs;        long expiry=20000;        for(int i=0; i < args.length; i++) {            if("-help".equals(args[i])) {                usage();                return;            }            if("-expiry".equals(args[i])) {                expiry=Long.parseLong(args[++i]);                continue;            }            if("-host".equals(args[i])) {                host=args[++i];                port=Integer.parseInt(args[++i]);                try {                    ip_addr=InetAddress.getByName(host);                    gossip_hosts.addElement(new IpAddress(ip_addr, port));                }                catch(Exception ex) {                    log.error(ex);                }                continue;            }            if("-keep_running".equals(args[i])) {                keep_running=true;                continue;            }            if("-get".equals(args[i])) {                get=true;                get_group=args[++i];                continue;            }            if("-register".equals(args[i])) {                register_group=args[++i];                register_host=args[++i];                register_port=Integer.parseInt(args[++i]);                register=true;                continue;            }            usage();            return;        }        if(gossip_hosts.size() == 0) {            log.error("At least 1 GossipServer has to be given");            return;        }        if(!register && !get) {            log.error("Neither get nor register command given, will not do anything");            return;        }        try {        }        catch(Throwable ex) {            log.error("GossipClient.main(): error initailizing JGroups Trace: " + ex);        }        try {            gossip_client=new GossipClient(gossip_hosts, expiry);            if(register) {                System.out.println("Registering " + register_group + " --> " + register_host + ':' + register_port);                gossip_client.register(register_group, new IpAddress(register_host, register_port));            }            if(get) {                System.out.println("Getting members for group " + get_group);                mbrs=gossip_client.getMembers(get_group);                System.out.println("Members for group " + get_group + " are " + mbrs);            }        }        catch(Exception ex) {            log.error(ex);        }        if(!keep_running)            gossip_client.stop();    }