public class AppsDeployingTomcatServletWebServerFactory
extends org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory
TomcatServletWebServerFactory
to be able to deploy additional WARs
packaged at classpath:META-INF/hipshoot/embedded-catalina/webapps/
.
If an environment property, hipshoot.embedded.catalina.wars
, is provided with a comma separated
string for the war file names (e.g, hipshoot.embedded.catalina.wars="site.war, cms.war"
), this
will look up those war file resources under classpath:META-INF/hipshoot/embedded-catalina/webapps/
,
extract the war file resources to a local file system directory designated as local embedded tomcat webapps
directory by another environment property, hipshoot.embedded.catalina.appBase
, and add each war
as web application context during the startup.
This reads the environment properties like the following:
hipshoot.embedded.catalina.appBase
:
The path of the web application base path (i.e, $CATALINA_BASE/webapps
folder)
where the additional war resources packaged in classpath:META-INF/hipshoot/embedded-catalina/webapps/
should be deployed onto.
hipshoot.embedded.catalina.wars
:
Comma separated string for the packaged war file resource names under classpath:META-INF/hipshoot/embedded-catalina/webapps/
.
e.g, "site.war, cms.war"
.
Please see CatalinaConfiguration
for a full list of the available properties.
Constructor and Description |
---|
AppsDeployingTomcatServletWebServerFactory(CatalinaConfiguration catalinaConfig)
Constructs with an
CatalinaConfiguration . |
Modifier and Type | Method and Description |
---|---|
void |
addTomcatCustomizers(TomcatCustomizer... customizers)
Add
Tomcat customizer(s). |
protected File |
getAppBaseDirectory()
Returns web application base directory (i.e, webapps directory) of the embedded tomcat.
|
protected org.springframework.boot.web.embedded.tomcat.TomcatWebServer |
getTomcatWebServer(org.apache.catalina.startup.Tomcat tomcat) |
protected void |
setAppBaseDirectory(File appBaseDirectory)
Sets web application base directory (i.e, webapps directory) of the embedded tomcat.
|
addAdditionalTomcatConnectors, addConnectorCustomizers, addContextCustomizers, addContextLifecycleListeners, addContextValves, addEngineValves, addTldSkipPatterns, configureContext, customizeConnector, getAdditionalTomcatConnectors, getContextLifecycleListeners, getContextValves, getEngineValves, getTldSkipPatterns, getTomcatConnectorCustomizers, getTomcatContextCustomizers, getUriEncoding, getWebServer, postProcessContext, prepareContext, setBackgroundProcessorDelay, setBaseDirectory, setContextLifecycleListeners, setContextValves, setEngineValves, setProtocol, setResourceLoader, setTldSkipPatterns, setTomcatConnectorCustomizers, setTomcatContextCustomizers, setUriEncoding
addInitializers, getContextPath, getDisplayName, getDocumentRoot, getInitParameters, getJsp, getLocaleCharsetMappings, getMimeMappings, getSession, getUrlsOfJarsWithMetaInfResources, getValidDocumentRoot, getValidSessionStoreDir, getValidSessionStoreDir, isRegisterDefaultServlet, mergeInitializers, setContextPath, setDisplayName, setDocumentRoot, setInitializers, setInitParameters, setJsp, setLocaleCharsetMappings, setMimeMappings, setRegisterDefaultServlet, setSession, shouldRegisterJspServlet
addErrorPages, createTempDir, getAddress, getCompression, getErrorPages, getHttp2, getPort, getServerHeader, getSsl, getSslStoreProvider, setAddress, setCompression, setErrorPages, setHttp2, setPort, setServerHeader, setSsl, setSslStoreProvider
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public AppsDeployingTomcatServletWebServerFactory(CatalinaConfiguration catalinaConfig)
CatalinaConfiguration
.catalinaConfig
- CatalinaConfiguration
public void addTomcatCustomizers(TomcatCustomizer... customizers)
Tomcat
customizer(s).customizers
- Tomcat
customizer(s)protected org.springframework.boot.web.embedded.tomcat.TomcatWebServer getTomcatWebServer(org.apache.catalina.startup.Tomcat tomcat)
Overridden to scan the packaged war file resources and deploy those before startup.
getTomcatWebServer
in class org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory
protected File getAppBaseDirectory()
protected void setAppBaseDirectory(File appBaseDirectory)
appBaseDirectory
- web application base directory (i.e, webapps directory) of the embedded tomcatCopyright © 2019. All rights reserved.