Class JettyRemoteDeployer
- java.lang.Object
-
- org.codehaus.cargo.util.log.LoggedObject
-
- org.codehaus.cargo.container.spi.deployer.AbstractDeployer
-
- org.codehaus.cargo.container.spi.deployer.AbstractRemoteDeployer
-
- org.codehaus.cargo.container.jetty.JettyRemoteDeployer
-
public class JettyRemoteDeployer extends AbstractRemoteDeployer
A remote deployer for the Jetty container.
NOTE: undeploy DELETES the webapp from the Jetty webapp directory.
Limitations:- Will not undeploy files from anywhere other than the servers webapp directory
- Cannot be used to undeploy webapps that were deployed using a xml context file in
/contexts
- Should not be used with multiple webapps sharing a common war
-
-
Constructor Summary
Constructors Constructor Description JettyRemoteDeployer(RemoteContainer container)
Remote deployer for the Jetty container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
createDefaultDeployerUrl(Configuration configuration)
Returns a deployerURL based on default values.void
deploy(Deployable deployable)
Deploy aDeployable
to the running container and make it available for requests.protected void
invoke(String path)
Invokes Tomcat manager with the specified command.protected String
invoke(String path, File fileData)
Invokes Jetty remote deployer web app with the specified command and content data.protected String
lastLine(String string)
Returns the last line of a string.void
undeploy(Deployable deployable)
Undeploy aDeployable
from the running container.-
Methods inherited from class org.codehaus.cargo.container.spi.deployer.AbstractRemoteDeployer
getContainer, getType
-
Methods inherited from class org.codehaus.cargo.container.spi.deployer.AbstractDeployer
deploy, deploy, redeploy, redeploy, redeploy, start, start, stop, stop, undeploy
-
Methods inherited from class org.codehaus.cargo.util.log.LoggedObject
getLogger, setLogger
-
-
-
-
Constructor Detail
-
JettyRemoteDeployer
public JettyRemoteDeployer(RemoteContainer container)
Remote deployer for the Jetty container.- Parameters:
container
- The container used for deployment
-
-
Method Detail
-
createDefaultDeployerUrl
protected String createDefaultDeployerUrl(Configuration configuration)
Returns a deployerURL based on default values.- Parameters:
configuration
- The server configuration object- Returns:
- The url for the deployer
-
deploy
public void deploy(Deployable deployable)
Deploy aDeployable
to the running container and make it available for requests.- Specified by:
deploy
in interfaceDeployer
- Overrides:
deploy
in classAbstractDeployer
- Parameters:
deployable
- theDeployable
to deploy
-
undeploy
public void undeploy(Deployable deployable)
Undeploy aDeployable
from the running container. NOTE: THIS WILL DELETE THE WAR FROM THE WEBAPP DIRECTORY- Specified by:
undeploy
in interfaceDeployer
- Overrides:
undeploy
in classAbstractDeployer
- Parameters:
deployable
- The deployable to be undeployed
-
invoke
protected void invoke(String path) throws IOException
Invokes Tomcat manager with the specified command.- Parameters:
path
- the Tomcat manager command to invoke- Throws:
IOException
- If there is an I/O issue communicating with the server
-
invoke
protected String invoke(String path, File fileData) throws IOException
Invokes Jetty remote deployer web app with the specified command and content data.- Parameters:
path
- the Jetty remote deployer web app command to invokefileData
- the file to stream as content data, if needed- Returns:
- the result of the invoking command, as returned by the Jetty remote deployer web app
- Throws:
IOException
- If there is an I/O issue communicating with the server
-
lastLine
protected String lastLine(String string) throws IOException
Returns the last line of a string.- Parameters:
string
- String of which to get the last line- Returns:
- Last line of
string
- Throws:
IOException
- if an i/o error occurs
-
-