Start an instance
@param home The home directory
@param options The options
@return True if started successfully; otherwise false
541121
public boolean start(String home, File options)
   {
      File homeDirectory = new File(home);
      
      if (!homeDirectory.exists())
         return false;

      stop(home);

      try
      {
         List<String> command = new ArrayList<String>();
         command.add(java);
         command.add("-Dironjacamar.home=" + home);

         if (options != null && options.exists())
            command.add("-Dironjacamar.options=" + options.getAbsolutePath());

         command.add("-Djava.net.preferIPv4Stack=true");
         command.add("-Djgroups.bind_addr=127.0.0.1");
         command.add("-Dorg.jboss.logging.Logger.pluginClass=org.jboss.logging.logmanager.LoggerPluginImpl");
         command.add("-Dlog4j.defaultInitOverride=true");
         command.add("-jar");
         command.add(home + "/bin/ironjacamar-sjc.jar");

         ProcessBuilder pb = new ProcessBuilder(command);
         pb.redirectErrorStream(true);

         Map<String, String> environment = pb.environment();
         environment.put("ironjacamar.home", home);

         Process p = pb.start();

         instances.put(home, p);

         return true;
      }
      catch (Throwable t)
      {
         // Ignore
      }

      return false;
   }
678091
protected static void launchNow(final Class<? extends Application> appClass, final String... args) {
        Application.launch(appClass, args);
    }
11078
public int stop(String home)
   {
      Process p = instances.get(home);
      if (p != null)
      {
         try
         {
            p.destroy();
            return p.exitValue();

         }
         catch (Throwable t)
         {
            return -1;
         }
         finally
         {
            instances.remove(home);
         }
      }

      return 0;
   }
755771
@Override
   public void execute() throws BuildException 
   {
      if (getHome() == null)
         throw new BuildException("Home isn't set");

      try 
      {
         ProcessController pc = ProcessController.getInstance();
         if (!pc.start(getHome(), options))
            throw new BuildException("IronJacamar instance couldn't be started from: " + getHome());

         log("Started IronJacamar instance from: " + getHome());
      }
      catch (BuildException be) 
      {
         throw be;
      }
      catch (Throwable t) 
      {
         throw new BuildException(t.getMessage(), t);
      }
   }
175671
def cmd_start(self, argv, help):
        """"""
        parser = argparse.ArgumentParser(
            prog="%s start" % self.progname,
            description=help,
        )
        instances = self.get_instances(command='start')
        parser.add_argument("instance", nargs=1,
                            metavar="instance",
                            help="Name of the instance from the config.",
                            choices=sorted(instances))
        parser.add_argument("-o", "--override", nargs="*", type=str,
                            dest="overrides", metavar="OVERRIDE",
                            help="Option to override in instance config for startup script (name=value).")
        args = parser.parse_args(argv)
        overrides = self._parse_overrides(args)
        overrides['instances'] = self.instances
        instance = instances[args.instance[0]]
        instance.hooks.before_start(instance)
        result = instance.start(overrides)
        instance.hooks.after_start(instance)
        if result is None:
            return
        instance.status()
437305
public static void main(final String[] args) {
        /*-
         * use one of the pre-defined amis
         * (all amis are pre-defined in aws-mock-default.properties or aws-mock.properties)
         */
        String imageId = "ami-12345678";
        final int runCount = 10;

        List<Instance> startedInstances = runInstances(imageId, runCount);

        System.out.println("Started instances: ");

        for (Instance i : startedInstances) {
            System.out.println(i.getInstanceId() + " - " + i.getState().getName());
        }
    }
135689
public static boolean start(RootDoc rootDoc) {
		CommandLine commandLine = parseCommandLine(rootDoc.options());
		Parser parser = new Parser();
		root = parser.parseRootDoc(rootDoc);
		save(commandLine, root);
		return true;
	}
418246
void start() throws IOException, InterruptedException {
		synchronized (startupShutdownLock) {
			LOG.info("Starting history server.");

			Files.createDirectories(webDir.toPath());
			LOG.info("Using directory {} as local cache.", webDir);

			Router router = new Router();
			router.addGet("/:*", new HistoryServerStaticFileServerHandler(webDir));

			if (!webDir.exists() && !webDir.mkdirs()) {
				throw new IOException("Failed to create local directory " + webDir.getAbsoluteFile() + ".");
			}

			createDashboardConfigFile();

			archiveFetcher.start();

			netty = new WebFrontendBootstrap(router, LOG, webDir, serverSSLFactory, webAddress, webPort, config);
		}
	}
1238332
public static boolean start(RootDoc root) {
        // In typical use, options will have been set up by calling validOptions,
        // which will create an HtmlDoclet for use here.
        HtmlDoclet doclet;
        if (docletToStart != null) {
            doclet = docletToStart;
            docletToStart = null;
        } else {
            doclet = new HtmlDoclet();
        }
        return doclet.startDoclet(root);
    }
1182273
protected void launch(String[] args) throws Exception {
		JarFile.registerUrlProtocolHandler();
		ClassLoader classLoader = createClassLoader(getClassPathArchives());
		launch(args, getMainClass(), classLoader);
	}
1021626
public EJSHome getStartedHome(J2EEName beanName) {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isDebugEnabled())
            Tr.debug(tc, "getStartedHome : " + beanName);

        HomeRecord hr = homeOfHomes.getHomeRecord(beanName); //LIDB859-4
        EJSHome hi = hr.getHomeAndInitialize(); //d199071
        if (hi == null) {
            // This method should only be called when it is known that the bean
            // has been started.  Doing nothing would result in an NPE, so report
            // a meaningful exception instead.                             d547849
            String msgTxt = "The " + beanName.getComponent() +
                            " bean in the " + beanName.getModule() +
                            " module of the " + beanName.getApplication() +
                            " application has been stopped and may no longer be used." +
                            " Wait for the bean to be started, and then try again.";
            throw new EJBStoppedException(msgTxt);
        }

        return hi;
    }
978877
def run(options)
      check_privileges
      AgentConfig.root_dir = AgentConfig.right_link_root_dirs

      if RightScale::Platform.windows?
        cleanup_certificates(options)
        # Write state file to indicate to RightScaleService that it should not
        # enter the rebooting state (which is the default behavior when the
        # RightScaleService starts).
        reenroller_state = {:reenroll => true}
        File.open(STATE_FILE, "w") { |f| f.write reenroller_state.to_json }
        print 'Restarting RightScale service...' if options[:verbose]
        res = system('net start RightScale')
        puts to_ok(res) if options[:verbose]
      else
        print 'Stopping RightLink daemon...' if options[:verbose]
        pid_file = AgentConfig.pid_file('instance')
        pid = pid_file ? pid_file.read_pid[:pid] : nil
        system('/opt/rightscale/bin/rchk --stop')
        # Wait for agent process to terminate
        retries = 0
        while process_running?(pid) && retries < 40
          sleep(0.5)
          retries += 1
          print '.' if options[:verbose]
        end
        puts to_ok(!process_running?(pid)) if options[:verbose]
        # Kill it if it's still alive after ~ 20 sec
        if process_running?(pid)
          print 'Forcing RightLink daemon to exit...' if options[:verbose]
          res = Process.kill('KILL', pid) rescue nil
          puts to_ok(res) if options[:verbose]
        end
        cleanup_certificates(options)

        # Resume option bypasses cloud state initialization so that we can
        # override the user data
        puts((options[:resume] ? 'Resuming' : 'Restarting') + ' RightLink daemon...') if options[:verbose]
        action = (options[:resume] ? 'resume' : 'start')
        res = system("/etc/init.d/rightlink #{action} > /dev/null")
      end
      true
    end
98849
@Synchronized
  final void start(Optional<String> name) {
    if (!this.isStarted) {
      this.startImpl(name);
      this.isStarted = true;
    }
  }
1242144
function Home() {
  // option hash values are set in the routes index.js module
  // and shared by all routing modules.
  this.options = {title: 'Default', randomQuote: false}; // Default value only.

  this.routeMe = function(req, res) {
    var fileName = req.params[0];
    res.render('home', { title: this.options.title });
    return;
  };
}
1184716
public void startImpl(Result<I> result)
  {
    DeployFactory2<I> builder = builder();
    
    if (builder == null) {
      result.ok(null);
      return;
    }
    
    if (! _lifecycle.toStarting()) {
      result.ok(_instance);
      return;
    }
    

    I deployInstance = null;

    boolean isActive = false;
    
    try {
      deployInstance = builder.get();
      
      _instance = deployInstance;

      isActive = true;
      
      result.ok(deployInstance);
    } catch (ConfigException e) {
      log.log(Level.FINEST, e.toString(), e);
      log.log(Level.FINE, e.toString(), e);
      
      result.fail(e);
    } catch (Throwable e) {
      log.log(Level.FINEST, e.toString(), e);
      log.log(Level.FINE, e.toString(), e);
      
      result.fail(e);
    } finally {
      if (isActive) {
        _lifecycle.toActive();
      }
      else {
        _lifecycle.toError();
      }
    }
  }
126714
@Validate
    public void start() {
        Boolean enabled = configuration.getBooleanWithDefault("ehcache.enabled", true);
        if (!enabled) {
            return;
        }

        File config = new File(configuration.getBaseDir(), CUSTOM_CONFIGURATION);
        final ClassLoader original = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
            if (config.isFile()) {
                manager = CacheManager.create(config.getAbsolutePath());
            } else {
                URL url = EhCacheService.class.getClassLoader().getResource(INTERNAL_CONFIGURATION);
                if (url != null) {
                    manager = CacheManager.create(url);
                } else {
                    throw new ExceptionInInitializerError("Cannot instantiate EhCache, " +
                            "cannot load " + INTERNAL_CONFIGURATION + " file");
                }
            }
            manager.addCache(WISDOM_KEY);
            cache = manager.getCache(WISDOM_KEY);

            registration = context.registerService(Cache.class, this, new Hashtable<String, Object>());
        } finally {
            Thread.currentThread().setContextClassLoader(original);
        }


    }
201099
public static boolean start(RootDoc root) throws Exception {
    umlProject = null;
    mainGui = null;
    Standard.start(root);
    setOptions(root);
    openOrCreateUmlProject(root);
    generateUml(root);
    return true;
  }