public GlassfishPreStartConfigurator setHttpPort(int port) { props.setPort("http-listener", port); return this; } }
private void addWebContainerIfRequested(Map<?, ?> properties, GlassFishProperties props) throws EJBException { String http_port = (properties == null)? null : (String)properties.get(GF_WEB_HTTP_PORT); if (http_port != null) { int port = 8080; try { port = Integer.parseInt(http_port); } catch (NumberFormatException e) { System.err.println("Using port 8080"); } props.setPort("http-listener-1", port); } }
private void addWebContainerIfRequested(Map<?, ?> properties, GlassFishProperties props) throws EJBException { String http_port = (properties == null)? null : (String)properties.get(GF_WEB_HTTP_PORT); if (http_port != null) { int port = 8080; try { port = Integer.valueOf(http_port); } catch (NumberFormatException e) { System.err.println("Using port 8080"); } props.setPort("http-listener", port); } }
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 LauncherMain(String[] args) { try { new CmdLineParser(this).parseArgument(args); } catch (CmdLineException ex) { throw new IllegalArgumentException(ex); } if (inputWar == null) { throw new IllegalArgumentException("No --deploy is given."); } if (configFile != null) { glassfishProperties.setConfigFileReadOnly(true); if (outputJar == null) { glassfishProperties.setConfigFileURI(new File(configFile).toURI().normalize().toString()); } } else { glassfishProperties.setConfigFileReadOnly(false); glassfishProperties.setPort("http-listener", httpListener); glassfishProperties.setPort("https-listener", httpsListener); } if (contextRoot != null) { deployProperties.setContextRoot(contextRoot); } if (libraries != null) { deployProperties.setLibraries(libraries); } }
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();