@Override public Deployer getDeployer() throws GlassFishException { return decoratedGf.getDeployer(); }
@Override public Deployer getDeployer() throws GlassFishException { return decoratedGf.getDeployer(); }
/** * Undeploys all deployed modules in reverse order. */ private void undeployModules() { try { Deployer deployer = glassFish.getDeployer(); while (!deployed.isEmpty()) { String applicationName = deployed.pop(); deployer.undeploy(applicationName); } } catch (GlassFishException exc) { throw new TestContainerException(exc); } }
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); } }
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 deployWar(URI warUri) throws GlassFishException { Deployer deployer = glassFish.getDeployer(); String appName = deployer.deploy(warUri, "--name", getApplicationName(), "--contextroot", getContextRoot()); if (! getApplicationName().equals(appName)) { throw new RuntimeException("error deploying WAR"); } }
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); } } }
private void shutdownInternal() throws GlassFishException { if (glassFish != null) { glassFish.getDeployer().undeploy(getApplicationName()); glassFish.stop(); glassFish = null; } }
/** * Construct new EJBContainerImpl instance */ EJBContainerImpl(GlassFish server) throws GlassFishException { this.server = server; this.server.start(); this.habitat = server.getService(ServiceLocator.class); deployer = server.getDeployer(); state = RUNNING; cleanup = new Cleanup(this); }
/** * Construct new EJBContainerImpl instance */ EJBContainerImpl(GlassFish server) throws GlassFishException { this.server = server; this.server.start(); this.habitat = server.getService(Habitat.class); deployer = server.getDeployer(); state = RUNNING; cleanup = new Cleanup(this); }
Deployer deployer = glassFish.getDeployer();
contextRoot = applicationName; Deployer deployer = glassFish.getDeployer(); deployer.deploy(uri, "--name", applicationName, "--contextroot", applicationName); deployed.push(applicationName);
public void undeploy(Archive<?> archive) throws DeploymentException { try { glassfish.getDeployer().undeploy(createDeploymentName(archive.getName())); } catch (Exception e) { throw new DeploymentException("Could not undeploy " + archive.getName(), e); } }
glassFish.start(); deployer = glassFish.getDeployer(); ScatteredArchive archive = new ScatteredArchive("glassfish-ejb-validation", Type.JAR); archive.addClassPath(new File("target", "classes"));
public ProtocolMetaData deploy(Archive<?> archive) throws DeploymentException { String deploymentName = createDeploymentName(archive.getName()); try { URL deploymentUrl = ShrinkWrapUtil.toURL(archive); glassfish.getDeployer().deploy(deploymentUrl.toURI(), "--name", deploymentName); } catch (Exception e) { throw new DeploymentException("Could not deploy " + archive.getName(), e); } try { HTTPContext httpContext = new HTTPContext(ADDRESS, bindHttpPort); findServlets(httpContext, resolveWebArchiveNames(archive)); return new ProtocolMetaData() .addContext(httpContext); } catch (GlassFishException e) { throw new DeploymentException("Could not probe GlassFish embedded for environment", e); } }