Search in sources :

Example 1 with OneTimeAddressGenerator

use of org.jgroups.util.OneTimeAddressGenerator in project JGroups by belaban.

the class Draw method main.

public static void main(String[] args) {
    Draw draw = null;
    String props = null;
    boolean no_channel = false;
    boolean jmx = true;
    boolean use_state = false;
    String group_name = null;
    long state_timeout = 5000;
    boolean use_unicasts = false;
    String name = null;
    boolean send_own_state_on_merge = true;
    AddressGenerator generator = null;
    for (int i = 0; i < args.length; i++) {
        if ("-help".equals(args[i])) {
            help();
            return;
        }
        if ("-props".equals(args[i])) {
            props = args[++i];
            continue;
        }
        if ("-no_channel".equals(args[i])) {
            no_channel = true;
            continue;
        }
        if ("-jmx".equals(args[i])) {
            jmx = Boolean.parseBoolean(args[++i]);
            continue;
        }
        if ("-clustername".equals(args[i])) {
            group_name = args[++i];
            continue;
        }
        if ("-state".equals(args[i])) {
            use_state = true;
            continue;
        }
        if ("-timeout".equals(args[i])) {
            state_timeout = Long.parseLong(args[++i]);
            continue;
        }
        if ("-use_unicasts".equals(args[i])) {
            use_unicasts = true;
            continue;
        }
        if ("-name".equals(args[i])) {
            name = args[++i];
            continue;
        }
        if ("-send_own_state_on_merge".equals(args[i])) {
            send_own_state_on_merge = Boolean.getBoolean(args[++i]);
            continue;
        }
        if ("-uuid".equals(args[i])) {
            generator = new OneTimeAddressGenerator(Long.parseLong(args[++i]));
            continue;
        }
        help();
        return;
    }
    try {
        draw = new Draw(props, no_channel, jmx, use_state, state_timeout, use_unicasts, name, send_own_state_on_merge, generator);
        if (group_name != null)
            draw.setClusterName(group_name);
        draw.go();
    } catch (Throwable e) {
        e.printStackTrace(System.err);
        System.exit(0);
    }
}
Also used : OneTimeAddressGenerator(org.jgroups.util.OneTimeAddressGenerator) OneTimeAddressGenerator(org.jgroups.util.OneTimeAddressGenerator) AddressGenerator(org.jgroups.stack.AddressGenerator)

Aggregations

AddressGenerator (org.jgroups.stack.AddressGenerator)1 OneTimeAddressGenerator (org.jgroups.util.OneTimeAddressGenerator)1