@Service
@PerLookup
@ContractsProvided(value={DeployerImpl.class,Deployer.class})
public class DeployerImpl
extends Object
implements Deployer
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.| Constructor and Description |
|---|
DeployerImpl() |
| Modifier and Type | Method and Description |
|---|---|
String |
deploy(File file,
String... params)
Deploys an application identified by a file.
|
String |
deploy(InputStream is,
String... params)
Deploys an application from the specified
InputStream object. |
String |
deploy(URI archive,
String... params)
Deploys an application identified by a URI.
|
Collection<String> |
getDeployedApplications()
Return names of all the deployed applications.
|
void |
undeploy(String appName,
String... params)
Undeploys an application from
GlassFish
This method takes a var-arg argument for the undeployment options. |
public String deploy(URI archive, String... params) throws GlassFishException
Deployer
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");
deploy in interface Deployerarchive - URI identifying the application to be deployed.params - Optional list of deployment options.GlassFishExceptionpublic String deploy(File file, String... params) throws GlassFishException
Deployerdeploy(file.toURI, params).deploy in interface Deployerfile - File or directory identifying the application to be deployed.params - Optional list of deployment options.GlassFishExceptionpublic String deploy(InputStream is, String... params) throws GlassFishException
DeployerInputStream object.
The input stream is closed when this method completes, even if an exception is thrown.deploy in interface Deployeris - InputStream used to read the content of the application.params - Optional list of deployment options.GlassFishExceptionpublic void undeploy(String appName, String... params) throws GlassFishException
DeployerGlassFish
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");
undeploy in interface DeployerappName - Identifier of the application to be undeployed.params - Undeployment options.GlassFishExceptionpublic Collection<String> getDeployedApplications() throws GlassFishException
DeployergetDeployedApplications in interface DeployerGlassFishExceptionCopyright © 2019. All rights reserved.