Class DeployerImpl

  • All Implemented Interfaces:
    Deployer

    @Service
    @PerLookup
    @ContractsProvided({DeployerImpl.class,Deployer.class})
    public class DeployerImpl
    extends Object
    implements Deployer
    This is an implementation of Deployer. Unlike the other EmbeddedDeployer, this deployer uses admin command execution framework to execute the underlying command, as a result we don't by-pass things like command replication code.
    Author:
    [email protected]
    • Constructor Detail

      • DeployerImpl

        public DeployerImpl()
    • Method Detail

      • deploy

        public String deploy​(URI archive,
                             String... params)
                      throws GlassFishException
        Description copied from interface: Deployer
        Deploys an application identified by a URI. URI is used as it is very extensible. GlassFish does not care about what URI scheme is used as long as there is a URL handler installed in the JVM to handle the scheme and a JarInputStream can be obtained from the given URI. This method takes a var-arg argument for the deployment options. Any option that's applicable to "asadmin deploy" command is also applicable here with same semantics. Please refer to GlassFish deployment guide for all available options.

        Examples:

        
                   deployer.deploy(new URI("http://acme.com/foo.war"));
        
                   deployer.deploy(new URI("http://acme.com/foo.war"),
                                            "--name", "bar", "--force", "true", "--create-tables", "true");
         
        Specified by:
        deploy in interface Deployer
        Parameters:
        archive - URI identifying the application to be deployed.
        params - Optional list of deployment options.
        Returns:
        the name of the deployed application
        Throws:
        GlassFishException
      • deploy

        public String deploy​(File file,
                             String... params)
                      throws GlassFishException
        Description copied from interface: Deployer
        Deploys an application identified by a file. Invoking this method is equivalent to invoking deploy(file.toURI, params).
        Specified by:
        deploy in interface Deployer
        Parameters:
        file - File or directory identifying the application to be deployed.
        params - Optional list of deployment options.
        Returns:
        the name of the deployed application
        Throws:
        GlassFishException
      • deploy

        public String deploy​(InputStream is,
                             String... params)
                      throws GlassFishException
        Description copied from interface: Deployer
        Deploys an application from the specified InputStream object. The input stream is closed when this method completes, even if an exception is thrown.
        Specified by:
        deploy in interface Deployer
        Parameters:
        is - InputStream used to read the content of the application.
        params - Optional list of deployment options.
        Returns:
        the name of the deployed application
        Throws:
        GlassFishException
      • undeploy

        public void undeploy​(String appName,
                             String... params)
                      throws GlassFishException
        Description copied from interface: Deployer
        Undeploys an application from GlassFish This method takes a var-arg argument for the undeployment options. Any option that's applicable to "asadmin undeploy" command is also applicable here with same semantics. Please refer to GlassFish deployment guide for all available options.

        Example:

                  deployer.undeploy("foo", "--drop-tables", "true");
         
        Specified by:
        undeploy in interface Deployer
        Parameters:
        appName - Identifier of the application to be undeployed.
        params - Undeployment options.
        Throws:
        GlassFishException