Package se.sics.mspsim.util

Examples of se.sics.mspsim.util.ServiceComponent


            }
          }
          return 0;
        }
        String name = context.getArgument(index++);
        ServiceComponent sc = getServiceForName(registry, name);
        if (sc == null) {
          if (verbose) {
            context.err.println("could not find service '" + name + "'");
            return 1;
          }
          return 0;
        }
        if (context.getArgumentCount() == index) {
          context.out.printf(" %-20s %s\n", sc.getName(), sc.getStatus());
          return 0;
        }
        String operation = context.getArgument(index);
        if ("start".equals(operation)) {
          if (sc.getStatus() == ServiceComponent.Status.STARTED) {
            context.out.println("service " + sc.getName() + " already started");
          } else {
            sc.start();
            context.out.println("service " + sc.getName() + " started");
          }
          return 0;
        }
        if ("stop".equals(operation)) {
          if (sc.getStatus() == ServiceComponent.Status.STOPPED) {
            context.out.println("service " + sc.getName() + " already stopped");
          } else {
            sc.stop();
            context.out.println("service " + sc.getName() + " stopped");
          }
          return 0;
        }
        context.err.println("unknown operation '" + operation + "'");
        return 1;
View Full Code Here

TOP

Related Classes of se.sics.mspsim.util.ServiceComponent

Copyright © 2018 www.massapicom. 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.