/** * Create a new instance of GlassFish with default {@link org.glassfish.embeddable.GlassFishProperties} * * @return New GlassFish instance. * @throws GlassFishException If at all fails to create a new GlassFish instance. */ public GlassFish newGlassFish() throws GlassFishException { return newGlassFish(new GlassFishProperties()); }
/** * Create a new instance of GlassFish with default {@link org.glassfish.embeddable.GlassFishProperties} * * @return New GlassFish instance. * @throws GlassFishException If at all fails to create a new GlassFish instance. */ public GlassFish newGlassFish() throws GlassFishException { return newGlassFish(new GlassFishProperties()); }
String port = System.getenv("PORT"); GlassFishProperties gfProps = new GlassFishProperties(); gfProps.setPort("http-listener", Integer.parseInt(port)); GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(gfProps); glassfish.start(); Deployer deployer = glassfish.getDeployer(); File file = new File("YourSimpleMavenWebapplication.war"); deployer.deploy(file);
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); } }
public void run() throws Exception { GlassFishProperties gfProps =new GlassFishProperties(); gfProps.setProperty("org.glassfish.embeddable.autoDelete", System.getProperty("org.glassfish.embeddable.autoDelete", "true"));
public void run() throws Exception { GlassFishProperties gfProps =new GlassFishProperties(); gfProps.setProperty("org.glassfish.embeddable.autoDelete", System.getProperty("org.glassfish.embeddable.autoDelete", "true"));
/** * 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); } }
GlassFishRuntime glassFishRuntime = GlassFishRuntime.bootstrap(bootstrapProps); GlassFishProperties gfProps = new GlassFishProperties();
BootstrapProperties bootstrapProperties = new BootstrapProperties(); bootstrapProperties.setInstallRoot("C:\\applicationserverdir"); GlassFishRuntime glassfishRuntime = GlassFishRuntime.bootstrap(bootstrapProperties); GlassFishProperties glassfishProperties = new GlassFishProperties(); glassfishProperties.setInstanceRoot("C:\\applicationserverdir\\domains\\myJavaFXAppDomain"); glassfishProperties.setPort("http-listener", 8080); glassfishProperties.setPort("https-listener", 8181); GlassFish glassfish = glassfishRuntime.newGlassFish(glassfishProperties); glassfish.start();
glassfishRuntime = GlassFishRuntime.bootstrap(bootstrapProps, getClass().getClassLoader()); GlassFishProperties gfProps = new GlassFishProperties(properties); setGlassFishProperties(gfProps, fs); glassfish = glassfishRuntime.newGlassFish(gfProps);
GlassFishProperties glassFishProperties = new GlassFishProperties(newProps); if (Boolean.getBoolean(KEEP_TEMPORARY_FILES)) { glassFishProperties.setProperty("org.glassfish.embeddable.autoDelete", "false"); // set autodelete to false.
glassfishRuntime = GlassFishRuntime.bootstrap(bootstrapProps, getClass().getClassLoader()); GlassFishProperties gfProps = new GlassFishProperties(properties); setGlassFishProperties(gfProps, fs); glassfish = glassfishRuntime.newGlassFish(gfProps);
GlassFishProperties serverProps = new GlassFishProperties();
cloned.putAll(glassFishProperties.getProperties()); final GlassFishProperties gfProps = new GlassFishProperties(cloned); setEnv(gfProps);
cloned.putAll(glassFishProperties.getProperties()); final GlassFishProperties gfProps = new GlassFishProperties(cloned); setEnv(gfProps);