Package org.glassfish.embeddable

Examples of org.glassfish.embeddable.Deployer


            throw new Exception("Embedded GlassFish [" + serverId + "] not running");
        }
        if (app == null) {
            throw new Exception("Application can not be null");
        }
        Deployer deployer = glassfish.getDeployer();
        final int len = deployParams.size();
        if (len > 0) {
            deployer.deploy(new File(app).toURI(), deployParams.toArray(new String[len]));
            System.out.println("Deployed [" + app + "] with parameters " + deployParams);
        } else {
            deployer.deploy(new File(app).toURI());
            System.out.println("Deployed [" + app + "]");
        }
    }
View Full Code Here


            throw new Exception("Embedded GlassFish [" + serverId + "] not running");
        }
        if (appName == null) {
            throw new Exception("Application name can not be null");
        }
        Deployer deployer = glassfish.getDeployer();
        deployer.undeploy(appName);
        System.out.println("Undeployed [" + appName + "]");
    }
View Full Code Here

            /*
            DeployCommandParameters deployCommandParameters = new DeployCommandParameters();
            deployCommandParameters.contextroot = this.appDescriptor.getContextPath();
            String name = server.getDeployer().deploy(war, deployCommandParameters);
             */
            Deployer deployer = glassfish.getDeployer();
            // Deploy my scattered web application
            //deployer.deploy(archive.toURI());
            if (warArchive == null) {
                LOGGER.info("warArchive is null, nothing deployed");
            } else {
                LOGGER.info("About to deploy [" + warArchive.toURI().toString() + "] from path [" + warArchive.toURI().getPath() + "]  to EmbeddedGlassFish instance [" + deployer.toString() + "] with context-root set to [" + this.appDescriptor.getContextPath() + "]");
                String deployedApp = deployer.deploy(warArchive.toURI());
                LOGGER.info("Deployed [" + deployedApp + "] to EmbeddedGlassFish instance [" + deployer.toString() + "] with context-root set to [" + this.appDescriptor.getContextPath() + "]");
            }
        } catch (org.glassfish.embeddable.GlassFishException ex) {
            LOGGER.info("Caught GlassFishException [" + ex.getMessage() + "] trying to start the embedded server instance");
            throw new TestContainerException(ex);
        } catch (java.io.IOException ioe) {
View Full Code Here

        }
    }

    private void undeployAllApplications() {
        java.util.Collection<java.lang.String> deployedApps;
        Deployer deployer;
        try {
            deployer = glassfish.getDeployer();
            // Return names of all the deployed applications.
            deployedApps = deployer.getDeployedApplications();

        } catch (GlassFishException glassFishException) {
            throw new TestContainerException(glassFishException);
        }

        //  undeploy each app in for-each loop
        for (String deployedApp : deployedApps) {
            try {
                //see http://java.net/jira/browse/EMBEDDED_GLASSFISH-123
                deployer.undeploy(deployedApp, "--droptables", "true");
            } catch (GlassFishException glassFishException) {
                throw new TestContainerException(glassFishException);
            }
            LOGGER.info("Undeployed = " + deployedApp);
        }
View Full Code Here

TOP

Related Classes of org.glassfish.embeddable.Deployer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.