Class JettyDeployer
- java.lang.Object
-
- org.codehaus.cargo.deployer.jetty.JettyDeployer
-
public class JettyDeployer extends Object
Contains the common deployment logic used by the Jetty Cargo deployer servlets.
This class deliberately has no dependency on either theServletAPI or theServletAPI. The servlet-specific classes adapt HTTP requests and responses to the abstractions defined here.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceJettyDeployer.ContextProvides the Jetty-specific context operations required by the deployer.static interfaceJettyDeployer.RequestProvides the request operations needed by the common deployer.static interfaceJettyDeployer.ResponseProvides the response operations needed by the common deployer.
-
Constructor Summary
Constructors Constructor Description JettyDeployer(JettyDeployer.Context context, File webAppDirectory, long timeout)Creates a deployer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddeploy(JettyDeployer.Response response, String contextPath, String warURL)Deploys a WAR referenced by a URL.protected voiddeployArchive(JettyDeployer.Request request, JettyDeployer.Response response, String contextPath)Deploys a WAR received as the request body.voiddoGet(JettyDeployer.Request request, JettyDeployer.Response response)Handles a GET request.voiddoPut(JettyDeployer.Request request, JettyDeployer.Response response)Handles a PUT request.protected StringgetWebAppFilename(String context)Converts a context path into the filename used for its WAR.protected voidundeploy(JettyDeployer.Response response, String contextPath)Undeploys a web application.
-
-
-
Constructor Detail
-
JettyDeployer
public JettyDeployer(JettyDeployer.Context context, File webAppDirectory, long timeout)
Creates a deployer.- Parameters:
context- Jetty context adapterwebAppDirectory- directory containing deployed WAR filestimeout- deployment timeout in milliseconds
-
-
Method Detail
-
doGet
public void doGet(JettyDeployer.Request request, JettyDeployer.Response response) throws IOException
Handles a GET request.- Parameters:
request- request adapterresponse- response adapter- Throws:
IOException- if the response cannot be written
-
doPut
public void doPut(JettyDeployer.Request request, JettyDeployer.Response response) throws IOException
Handles a PUT request.- Parameters:
request- request adapterresponse- response adapter- Throws:
IOException- if the response cannot be written
-
deploy
protected void deploy(JettyDeployer.Response response, String contextPath, String warURL) throws IOException
Deploys a WAR referenced by a URL.- Parameters:
response- response adaptercontextPath- context pathwarURL- WAR URL- Throws:
IOException- if the WAR cannot be copied
-
deployArchive
protected void deployArchive(JettyDeployer.Request request, JettyDeployer.Response response, String contextPath) throws IOException
Deploys a WAR received as the request body.- Parameters:
request- request adapterresponse- response adaptercontextPath- context path- Throws:
IOException- if the WAR cannot be written
-
undeploy
protected void undeploy(JettyDeployer.Response response, String contextPath) throws IOException
Undeploys a web application.- Parameters:
response- response adaptercontextPath- context path- Throws:
IOException- if the response cannot be written
-
-