Class JettyDeployerJetty
- java.lang.Object
-
- org.codehaus.cargo.deployer.jetty.JettyDeployerServlet
-
- org.codehaus.cargo.deployer.jetty.JettyDeployerJetty
-
- Direct Known Subclasses:
JettyDeployerJakartaEE10,JettyDeployerJakartaEE11,JettyDeployerJakartaEE9,JettyDeployerJavax
public abstract class JettyDeployerJetty extends JettyDeployerServlet
Provides common Jetty server operations for the Cargo deployer.The EE-specific subclasses provide the actual web application context implementation and identify the Jetty environment in which the application must be deployed.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedJettyDeployerJetty(Object context)Creates the Jetty deployer.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected JettyDeployer.ContextcreateContextAdapter()Creates the Jetty context adapter.protected voiddeployWebApp(String contextPath, File warFile)Deploys a WAR.protected ObjectgetContext()Returns the current web application context.protected org.eclipse.jetty.server.handler.ContextHandlerCollectiongetContextHandlerCollection()Returns the Jetty context handler collection used by the deployer.protected abstract StringgetContextPath(Object contextHandler)Returns the context path of a web application.protected abstract StringgetEnvironmentName()Returns the Jetty environment name used by this deployer.protected abstract org.eclipse.jetty.server.ServergetServer()Returns the current Jetty server.protected org.eclipse.jetty.deploy.StandardDeployergetStandardDeployer()Returns the Jetty StandardDeployer.protected abstract booleanisWebAppContext(org.eclipse.jetty.server.Handler handler)Determines whether an object is a web application context.protected StringundeployWebApp(Object contextHandler)Undeploys a web application.-
Methods inherited from class org.codehaus.cargo.deployer.jetty.JettyDeployerServlet
getDeployer, initialize
-
-
-
-
Constructor Detail
-
JettyDeployerJetty
protected JettyDeployerJetty(Object context)
Creates the Jetty deployer.- Parameters:
context- current web application context
-
-
Method Detail
-
getServer
protected abstract org.eclipse.jetty.server.Server getServer()
Returns the current Jetty server.- Returns:
- Jetty server
-
getEnvironmentName
protected abstract String getEnvironmentName()
Returns the Jetty environment name used by this deployer.- Returns:
- environment name
-
getContextPath
protected abstract String getContextPath(Object contextHandler)
Returns the context path of a web application.- Parameters:
contextHandler- web application context- Returns:
- context path
-
isWebAppContext
protected abstract boolean isWebAppContext(org.eclipse.jetty.server.Handler handler)
Determines whether an object is a web application context.- Parameters:
handler- Jetty handler- Returns:
trueif the handler is a web application context
-
getStandardDeployer
protected org.eclipse.jetty.deploy.StandardDeployer getStandardDeployer()
Returns the Jetty StandardDeployer.The deployer is normally installed in the server's component tree. The contained-bean lookup is also used because a
DeploymentScannermay own the deployer.- Returns:
- StandardDeployer
-
getContextHandlerCollection
protected org.eclipse.jetty.server.handler.ContextHandlerCollection getContextHandlerCollection()
Returns the Jetty context handler collection used by the deployer.- Returns:
- context handler collection
-
deployWebApp
protected void deployWebApp(String contextPath, File warFile) throws Exception
Deploys a WAR.The context is deliberately created through
StandardContextHandlerFactory. This is important in Jetty 12.1 because the factory creates and configures the web application using the appropriate Jetty environment and environment classloader.- Parameters:
contextPath- context pathwarFile- WAR file- Throws:
Exception- if deployment fails
-
undeployWebApp
protected String undeployWebApp(Object contextHandler) throws Exception
Undeploys a web application.- Parameters:
contextHandler- web application context- Returns:
- WAR location
- Throws:
Exception- if undeployment fails
-
createContextAdapter
protected JettyDeployer.Context createContextAdapter()
Creates the Jetty context adapter.- Specified by:
createContextAdapterin classJettyDeployerServlet- Returns:
- Jetty context adapter
-
getContext
protected Object getContext()
Returns the current web application context.- Returns:
- current web application context
-
-