/** * Bootstrap GlassFish runtime based on runtime configuration passed in the bootstrapProperties object. * This is a convenience method. Calling this method is same as * calling {@link #bootstrap(BootstrapProperties , ClassLoader)} with null as second argument. * * @param bootstrapProperties BootstrapProperties used to setup the runtime * @throws GlassFishException */ public static GlassFishRuntime bootstrap(BootstrapProperties bootstrapProperties) throws GlassFishException { return bootstrap(bootstrapProperties, GlassFishRuntime.class.getClassLoader()); }
/** * Bootstrap GlassFish runtime based on runtime configuration passed in the bootstrapProperties object. * This is a convenience method. Calling this method is same as * calling {@link #bootstrap(BootstrapProperties , ClassLoader)} with null as second argument. * * @param bootstrapProperties BootstrapProperties used to setup the runtime * @throws GlassFishException */ public static GlassFishRuntime bootstrap(BootstrapProperties bootstrapProperties) throws GlassFishException { return bootstrap(bootstrapProperties, GlassFishRuntime.class.getClassLoader()); }
/** * Bootstrap a GlassFishRuntime with default {@link BootstrapProperties}. * * @return Bootstrapped GlassFishRuntime * @throws GlassFishException if the GlassFishRuntime is already bootstrapped. */ public static GlassFishRuntime bootstrap() throws GlassFishException { return bootstrap(new BootstrapProperties(), GlassFishRuntime.class.getClassLoader()); }
/** * Bootstrap a GlassFishRuntime with default {@link BootstrapProperties}. * * @return Bootstrapped GlassFishRuntime * @throws GlassFishException if the GlassFishRuntime is already bootstrapped. */ public static GlassFishRuntime bootstrap() throws GlassFishException { return bootstrap(new BootstrapProperties(), GlassFishRuntime.class.getClassLoader()); }
private void launch() { try { GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(glassfishProperties); glassfish.start(); glassfish.getDeployer().deploy(new File(inputWar), deployProperties.getDeployOptions()); } catch (Throwable th) { Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "Server was stopped.", th); System.exit(1); } }
private void start() { try ( InputStream gpis = this.getClass().getClassLoader().getResourceAsStream("uber-jar_glassfish.properties"); InputStream dpis = this.getClass().getClassLoader().getResourceAsStream("uber-jar_deploy.properties"); InputStream wis = this.getClass().getClassLoader().getResourceAsStream("uber-jar_application.war")) { GlassFishProperties glassfishProperties = new GlassFishProperties(); glassfishProperties.getProperties().load(gpis); URL url = this.getClass().getClassLoader().getResource("uber-jar_domain.xml"); if (url != null) { glassfishProperties.setConfigFileURI(url.toURI().toString()); } DeployProperties deployProperties = new DeployProperties(); deployProperties.load(dpis); GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(glassfishProperties); glassfish.start(); glassfish.getDeployer().deploy(wis, deployProperties.getDeployOptions()); } catch (Throwable th) { Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "Server was stopped.", th); System.exit(1); } } }
public void start(BundleContext context) throws Exception { nonEmbedded = context.getProperty(Constants.BUILDER_NAME_PROPERTY) != null; if (nonEmbedded) { GlassFishRuntime embeddedGfr = new EmbeddedOSGiGlassFishRuntime(context); context.registerService(GlassFishRuntime.class.getName(), embeddedGfr, null); System.out.println("Registered " + embeddedGfr + " in service registry."); } else { Properties properties = prepareStartupContext(context); final BootstrapProperties bsProperties = new BootstrapProperties(properties); System.out.println(GlassFishRuntime.class + " is loaded by [" + GlassFishRuntime.class.getClassLoader() + "]"); GlassFishRuntime existingGfr = lookupGfr(context); if (existingGfr == null) { System.out.println("Bootstrapping a new GlassFishRuntime"); // Should we do the following in a separate thread? gfr = GlassFishRuntime.bootstrap(bsProperties, getClass().getClassLoader()); existingGfr = gfr; } else { System.out.println("Using existing GlassFishRuntime: [" + existingGfr + "]"); } gf = existingGfr.newGlassFish(new GlassFishProperties(properties)); gf.start(); } }
public void start(BundleContext context) throws Exception { nonEmbedded = context.getProperty(Constants.BUILDER_NAME_PROPERTY) != null; if (nonEmbedded) { GlassFishRuntime embeddedGfr = new EmbeddedOSGiGlassFishRuntime(context); context.registerService(GlassFishRuntime.class.getName(), embeddedGfr, null); System.out.println("Registered " + embeddedGfr + " in service registry."); } else { Properties properties = prepareStartupContext(context); final BootstrapProperties bsProperties = new BootstrapProperties(properties); System.out.println(GlassFishRuntime.class + " is loaded by [" + GlassFishRuntime.class.getClassLoader() + "]"); GlassFishRuntime existingGfr = lookupGfr(context); if (existingGfr == null) { System.out.println("Bootstrapping a new GlassFishRuntime"); // Should we do the following in a separate thread? gfr = GlassFishRuntime.bootstrap(bsProperties, getClass().getClassLoader()); existingGfr = gfr; } else { System.out.println("Using existing GlassFishRuntime: [" + existingGfr + "]"); } gf = existingGfr.newGlassFish(new GlassFishProperties(properties)); gf.start(); } }
public void launch(Properties ctx) throws Exception { addShutdownHook(); gfr = GlassFishRuntime.bootstrap(new BootstrapProperties(ctx), getClass().getClassLoader()); gf = gfr.newGlassFish(new GlassFishProperties(ctx)); if (Boolean.valueOf(Util.getPropertyOrSystemProperty(ctx, "GlassFish_Interactive", "false"))) { startConsole(); } else { gf.start(); } }
public void launch(Properties ctx) throws Exception { addShutdownHook(); gfr = GlassFishRuntime.bootstrap(new BootstrapProperties(ctx), getClass().getClassLoader()); gf = gfr.newGlassFish(new GlassFishProperties(ctx)); if (Boolean.valueOf(Util.getPropertyOrSystemProperty(ctx, "GlassFish_Interactive", "false"))) { startConsole(); } else { gf.start(); } }
public synchronized void launch() { if (glassFish != null) { return; } /* * Running under "Run as JUnit test" from Eclipse in a separate process, we do not get * notified when Eclipse is finished running the test suite. The shutdown hook is just * to be on the safe side. */ addShutdownHook(); File domainConfig = getConfiguration(); if (!domainConfig.exists()) { throw new IllegalArgumentException(domainConfig + " not found"); } GlassFishProperties gfProps = new GlassFishProperties(); if (domainConfig.exists()) { gfProps.setConfigFileURI(domainConfig.toURI().toString()); } try { glassFish = GlassFishRuntime.bootstrap().newGlassFish(gfProps); glassFish.start(); } catch (GlassFishException exc) { throw new RuntimeException(exc); } }
System.getProperty("org.glassfish.embeddable.autoDelete", "true")); gf = GlassFishRuntime.bootstrap().newGlassFish(gfProps);
public void start() { try { if (gfr == null) { gfr = GlassFishRuntime.bootstrap(); } if (gf == null) { gf = gfr.newGlassFish(configurator.getProps()); gf.start(); } glassfishFuture.setGlassFish(gf); log.info("Executing {} startup commands.", startupCommands.size()); for (AbstractAdminObject command : startupCommands) { try { log.info("Executing command: {}", command); command.execute(ctx); } catch (Exception e) { log.error("Startup failed. ", e); fail(); } } } catch (GlassFishException e) { log.error("Startup failed", e); fail(); } }
System.getProperty("org.glassfish.embeddable.autoDelete", "true")); gf = GlassFishRuntime.bootstrap().newGlassFish(gfProps);
/** * Starts the GlassFish container. */ @Override public void start() { System.setProperty("java.protocol.handler.pkgs", "org.ops4j.pax.url"); ConfigurationManager cm = new ConfigurationManager(); configDirName = cm.getProperty(GLASSFISH_CONFIG_DIR_KEY, "src/test/resources/glassfish-config"); File domainConfig = new File(configDirName, "domain.xml"); GlassFishProperties gfProps = new GlassFishProperties(); if (domainConfig.exists()) { gfProps.setConfigFileURI(domainConfig.toURI().toString()); } try { glassFish = GlassFishRuntime.bootstrap().newGlassFish(gfProps); glassFish.start(); // set access point in test directory String portNumber = getPortNumber(domainConfig); testDirectory.setAccessPoint(new URI("http://localhost:" + portNumber + "/Pax-Exam-Probe/")); deployModules(); } catch (GlassFishException e) { throw new TestContainerException("Problem starting test container.", e); } catch (URISyntaxException e) { throw new TestContainerException("Problem starting test container.", e); } }
runtime = GlassFishRuntime.bootstrap(bootstrapProperties); _logger.info("[EJBContainerProviderImpl] Using runtime class: " + runtime.getClass()); GlassFish server = runtime.newGlassFish(glassFishProperties);
BootstrapProperties bootstrapProps = new BootstrapProperties(properties); setBootstrapProperties(bootstrapProps, fs); glassfishRuntime = GlassFishRuntime.bootstrap(bootstrapProps, getClass().getClassLoader());
runtime = GlassFishRuntime.bootstrap(bootstrapProperties); GlassFish server = runtime.newGlassFish(glassFishProperties); if (l != null && !l.reuse_instance_location) {
BootstrapProperties bootstrapProps = new BootstrapProperties(properties); setBootstrapProperties(bootstrapProps, fs); glassfishRuntime = GlassFishRuntime.bootstrap(bootstrapProps, getClass().getClassLoader());
glassfishRuntime = GlassFishRuntime.bootstrap(bootstrapProps); } catch (Exception e) { throw new RuntimeException("Could not setup GlassFish Embedded Bootstrap", e);