Package org.glassfish.embeddable
Interface Deployer
public interface Deployer
Deployer service for GlassFish. Using this service, one can deploy and undeploy applications.
It accepts URI as an input for deployment and hence is very easily extensible. User can install their own
custom URL handler in Java runtime and create URIs with their custom scheme and pass them to deploy method.
- Author:
- Sanjeeb.Sahoo@Sun.COM
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionDeploys an application identified by a file.deploy(InputStream is, String... params) Deploys an application from the specifiedInputStreamobject.Deploys an application identified by a URI.Return names of all the deployed applications.voidUndeploys an application fromGlassFishThis method takes a var-arg argument for the undeployment options.
-
Method Details
-
deploy
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");- 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
Deploys an application identified by a file. Invoking this method is equivalent to invokingdeploy(file.toURI, params).- 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
Deploys an application from the specifiedInputStreamobject. The input stream is closed when this method completes, even if an exception is thrown.- 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
Undeploys an application fromGlassFishThis 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");- Parameters:
appName- Identifier of the application to be undeployed.params- Undeployment options.- Throws:
GlassFishException
-
getDeployedApplications
Return names of all the deployed applications.- Returns:
- names of deployed applications.
- Throws:
GlassFishException
-