public void runAnotherApp(Class<? extends Application> anotherAppClass) throws Exception { Application app2 = anotherAppClass.newInstance(); Stage anotherStage = new Stage(); app2.start(anotherStage); }
private static void launchApplication1(final Class<? extends Application> appClass, final Class<? extends Preloader> preloaderClass, final String[] args) throws Exception { //... Lots of stuff // Eventually, on line 755: currentPreloader.start(primaryStage); // More things for cases where the previous start() call isn't appropriate // Line 773: final AtomicReference<Application> app = new AtomicReference<>(); // Line 790/791: Constructor<? extends Application> c = appClass.getConstructor(); // Gets constructor for your class app.set(c.newInstance()); // Creates a new instance of your class // Line 803: final Application theApp = app.get(); // Line 837: theApp.start(primaryStage); }
Application app = new Main(); app.start(JmeContext.Type.Headless);
@Override public synchronized void start() throws Exception { setName( polygeneApplication.name() ); Series<Parameter> parameters = getContext().getParameters(); String mode = parameters.getFirstValue( "org.apache.polygene.runtime.mode" ); super.start(); getLogger().info( "RestApplication successfully started." ); }
@Override public void init() throws ServletException { if ((getComponent() != null)) { if ((getApplication() != null) && (getApplication().isStopped())) { try { getApplication().start(); } catch (Exception e) { log("Error during the starting of the Restlet Application", e); } } } }
@Override public void init() throws ServletException { if ((getComponent() != null)) { if ((getApplication() != null) && (getApplication().isStopped())) { try { getApplication().start(); } catch (Exception e) { log("Error during the starting of the Restlet Application", e); } } } }
application.start();