Main.java
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2013 Yujin Robot.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
00005  * use this file except in compliance with the License. You may obtain a copy of
00006  * the License at
00007  *
00008  * http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
00012  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
00013  * License for the specific language governing permissions and limitations under
00014  * the License.
00015  */
00016 
00017 package com.github.rosjava.zeroconf_jmdns_suite.jmdns.tutorials;
00018 
00019 import java.io.IOException;
00020 //import java.util.Enumeration;
00021 //import java.util.logging.ConsoleHandler;
00022 //import java.util.logging.Level;
00023 //import java.util.logging.LogManager;
00024 //import java.util.logging.Logger;
00025 
00035 public class Main {
00036     public static void main(String argv[]) throws IOException {
00037         int argc = argv.length;
00038 //        boolean debug = false;
00039 //
00040 //        if ((argc > 0) && "--debug".equals(argv[0])) {
00041 //            System.arraycopy(argv, 1, argv, 0, --argc);
00042 //
00043 //            {
00044 //                ConsoleHandler handler = new ConsoleHandler();
00045 //                handler.setLevel(Level.FINEST);
00046 //                for (Enumeration<String> enumerator = LogManager.getLogManager().getLoggerNames(); enumerator.hasMoreElements();) {
00047 //                    String loggerName = enumerator.nextElement();
00048 //                    Logger logger = Logger.getLogger(loggerName);
00049 //                    logger.addHandler(handler);
00050 //                    logger.setLevel(Level.FINEST);
00051 //                }
00052 //            }
00053 //            debug = true;
00054 //        }
00055 //
00056                 if (argc == 0) {
00057                 Main.usage();
00058             System.exit(1);
00059                 } else if ( "--polling".equals(argv[0])) {
00060                         Discovery.main_polling();
00061                 } else if ( "--publisher".equals(argv[0]) ) {
00062                         Publisher.main_publisher();
00063                 } else if ( "--discovery".equals(argv[0]) ) {
00064                         Discovery.main_handler();
00065         } else {
00066                 Main.usage();
00067             System.exit(1);
00068         }
00069     }
00070     public static void usage() {
00071         System.out.println();
00072         System.out.println("This bundle incorporates several jmdns tutorials, specify which one you wish to run:\n");
00073         System.out.println("     --publisher      - publishes a _ros-master._tcp for 8s");
00074         System.out.println("     --polling        - polling discovery for ros masters (_ros-master._tcp)");
00075         System.out.println("     --discovery      - callback discovery for ros services (ros, concert, app-manager)");
00076         System.out.println();
00077     }
00078 }


zeroconf_jmdns_suite
Author(s): Daniel Stonier
autogenerated on Thu Aug 27 2015 15:50:27