Examples of MasterAddress


Examples of pku.cbi.abcgrid.worker.conf.MasterAddress

     *
     * */
    public static void main(String[] args)
    {
        Console con = new Console();
        MasterAddress master_to_connect;
        master_to_connect = parseArgs(args);
        if (master_to_connect == null)
        {
            printUsageAndExit(null);
        }
View Full Code Here

Examples of pku.cbi.abcgrid.worker.conf.MasterAddress

        System.exit(0);
    }

    private static MasterAddress parseArgs(String[] args)
    {
        MasterAddress ma = new MasterAddress();
        if (args.length < 2)
            return null;
        for (int i = 0; i < args.length; i++)
        {
            String s = args[i];
            if (s.equalsIgnoreCase("-h"))
            {
                String host = "";
                try
                {
                    host = args[i+1];
                    ma.setIp(host);
                }
                catch(Exception e)
                {
                    printUsageAndExit(String.format("host:[%s] is incorrect", host));
                }

            }
            if (s.equalsIgnoreCase("-p"))
            {
                String port="";
                try
                {
                    port = args[i + 1];
                    Integer.valueOf(port);
                    ma.setPort(port);
                }
                catch(Exception e)
                {
                    printUsageAndExit(String.format("port:[%s] is incorrect", port));
                }
            }
            if (s.equalsIgnoreCase("-s"))
            {
                String serv="";
                try
                {
                    serv = args[i+1];
                    ma.setName(serv);
                }
                catch(Exception e)
                {
                    printUsageAndExit(String.format("service:[%s] is incorrect", serv));
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.