public class TomcatBoot extends Object
| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected String |
baseDir |
protected BootLogger |
bootLogger |
protected boolean |
browseOnDesktop |
protected String |
configFile |
protected Properties |
configProps |
protected String |
contextPath |
protected static String |
DEFAULT_MARK_DIR |
protected boolean |
development |
protected String[] |
extendsConfigFiles |
protected LikeItCatalinaSetupper |
likeitCatalinaSetupper |
protected String |
loggingFile |
protected Consumer<TomcatLoggingOption> |
loggingOptionCall |
protected int |
port |
protected BootPropsTranslator |
propsTranslator |
protected List<String> |
readConfigList |
protected org.apache.catalina.startup.Tomcat |
server |
protected boolean |
suppressShutdownHook |
protected Predicate<String> |
tldFilesSelector |
protected boolean |
useAnnotationDetect |
protected boolean |
useMetaInfoResourceDetect |
protected boolean |
useTldDetect |
protected boolean |
useWebFragmentsDetect |
protected Predicate<String> |
webFragmentsSelector |
protected YourValveOption |
yourValveOption |
| コンストラクタと説明 |
|---|
TomcatBoot(int port,
String contextPath)
Create with port number and context path.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
protected void |
adjustServer() |
TomcatBoot |
asDevelopment()
Does it boot the tomcat server as development mode?
|
TomcatBoot |
asDevelopment(boolean development)
Does it boot the tomcat server as development mode?
|
protected void |
assertDevelopmentState() |
TomcatBoot |
asYouLikeIt(LikeItCatalinaSetupper resourceLambda)
You can customize tomcat resource (e.g. host, context) as you like (it).
|
TomcatBoot |
atBaseDir(String baseDir)
Set base directory of tomcat server.
|
void |
await() |
TomcatBoot |
bootAwait() |
TomcatBoot |
browseOnDesktop()
Browse on desktop automatically after boot finished.
|
protected void |
browseOnDesktop(URI uri) |
protected String |
buildMarkFilePath() |
protected void |
cleanPreviousExtractedWarDir(File appBaseFile) |
void |
close() |
TomcatBoot |
configure(String configFile,
String... extendsConfigFiles)
You can configure tomcat options by application properties.
|
protected BootPropsTranslator |
createBootPropsTranslator() |
protected org.apache.catalina.startup.Tomcat |
createTomcat() |
protected File |
deriveWebappDir() |
protected void |
disableUnpackWARsOption() |
protected void |
doSetupWebappContextWar(String warPath) |
protected void |
doSetupWebappContextWebappDir() |
protected File |
findProjectWebappDir(String webappRelativePath) |
protected String |
getBasicWebappRelativePath() |
protected String |
getMarkDir() |
org.apache.catalina.startup.Tomcat |
getServer() |
protected long |
getShuwdownHookWaitMillis() |
void |
go() |
protected void |
info(String msg) |
protected boolean |
isUnpackWARsDisabled() |
protected void |
loadServerConfigIfNeeds() |
protected void |
loadServerLoggingIfNeeds() |
TomcatBoot |
logging(String loggingFile,
Consumer<TomcatLoggingOption> opLambda)
You can set tomcat logging by application properties.
|
protected boolean |
needsShutdown(File markFile,
long lastModified) |
protected RhythmicalTomcat |
newRhythmicalTomcat(BootLogger bootLogger,
RhythmicalHandlingDef.AnnotationHandling annotationHandling,
RhythmicalHandlingDef.MetaInfoResourceHandling metaInfoResourceHandling,
RhythmicalHandlingDef.TldHandling tldHandling,
Predicate<String> tldFilesSelector,
RhythmicalHandlingDef.WebFragmentsHandling webFragmentsHandling,
Predicate<String> webFragmentsSelector,
AccessLogOption accessLogOption,
YourValveOption yourValveOption,
LikeItCatalinaSetupper likeitCatalinaSetupper) |
protected AccessLogOption |
prepareAccessLogOption() |
protected RhythmicalHandlingDef.AnnotationHandling |
prepareAnnotationHandling() |
protected LikeItCatalinaSetupper |
prepareLikeItCatalinaSetupper() |
protected File |
prepareMarkFile() |
protected RhythmicalHandlingDef.MetaInfoResourceHandling |
prepareMetaInfoResourceHandling() |
protected void |
prepareServer() |
protected Predicate<String> |
prepareTldFilesSelector() |
protected RhythmicalHandlingDef.TldHandling |
prepareTldHandling() |
protected void |
prepareUnpackWARsEnv() |
protected RhythmicalHandlingDef.WebFragmentsHandling |
prepareuseWebFragmentsHandling() |
protected String |
prepareWarPath() |
protected String |
prepareWebappPath() |
protected Predicate<String> |
prepareWebFragmentsSelector() |
protected String |
prepareWebXmlPath(String webappPath) |
protected YourValveOption |
prepareYourValveOption() |
protected Properties |
readConfigProps(String propFile) |
void |
ready() |
protected void |
registerShutdownHook() |
protected String |
resolveConfigEnvPath(String envPath) |
protected void |
setupServerConfigIfNeeds() |
protected void |
setupWebappContext() |
protected void |
shutdownForcedly() |
protected URI |
startServer() |
TomcatBoot |
suppressShutdownHook()
Suppress shutdown hook.
|
TomcatBoot |
useAnnotationDetect()
You can detect annotations in all jar files.
|
TomcatBoot |
useMetaInfoResourceDetect()
You can detect 'META-INF' resources in jar files detected as web fragments.
|
TomcatBoot |
useTldDetect()
You can detect '.tdl' files in all jar files.
|
TomcatBoot |
useTldDetect(Predicate<String> oneArgLambda)
You can detect '.tdl' files in selected jar files.
|
TomcatBoot |
useWebFragmentsDetect()
You can detect web fragments in all jar files.
|
TomcatBoot |
useWebFragmentsDetect(Predicate<String> oneArgLambda)
You can detect web fragments in selected jar files.
|
TomcatBoot |
valve(org.apache.catalina.Valve yourValve)
Add your valve for tomcat server.
|
protected void |
waitForExistingServerShuwdown() |
protected void |
waitForNextShuwdownHook() |
protected final int port
protected final String contextPath
protected boolean development
protected boolean browseOnDesktop
protected boolean suppressShutdownHook
protected boolean useAnnotationDetect
protected boolean useMetaInfoResourceDetect
protected boolean useTldDetect
protected boolean useWebFragmentsDetect
protected String configFile
protected String[] extendsConfigFiles
protected String loggingFile
protected Consumer<TomcatLoggingOption> loggingOptionCall
protected String baseDir
protected YourValveOption yourValveOption
protected LikeItCatalinaSetupper likeitCatalinaSetupper
protected Properties configProps
protected BootLogger bootLogger
protected org.apache.catalina.startup.Tomcat server
protected final BootPropsTranslator propsTranslator
public TomcatBoot(int port,
String contextPath)
e.g. has context path TomcatBoot boot = new TomcatBoot(8152, "/fortress"); e.g. no context path TomcatBoot boot = new TomcatBoot(8152, "");
port - The port number for the tomcat server.contextPath - The context path for the tomcat server, basically has slash prefix. (NotNull, EmptyAllowed)protected BootPropsTranslator createBootPropsTranslator()
public TomcatBoot asDevelopment()
public TomcatBoot asDevelopment(boolean development)
development - Is it development mode?public TomcatBoot browseOnDesktop()
public TomcatBoot suppressShutdownHook()
protected void assertDevelopmentState()
public TomcatBoot useAnnotationDetect()
public TomcatBoot useMetaInfoResourceDetect()
public TomcatBoot useTldDetect()
public TomcatBoot useTldDetect(Predicate<String> oneArgLambda)
boot.useTldDetect(jarName -> {
return jarName.contains("lasta-taglib");
});
oneArgLambda - The callback for selector of tld files, argument is jar name. (NotNull)public TomcatBoot useWebFragmentsDetect()
public TomcatBoot useWebFragmentsDetect(Predicate<String> oneArgLambda)
boot.useMetaInfoResourceDetect().useWebFragmentsDetect(jarName -> { // for swagger
return jarName.contains("swagger-ui");
});
oneArgLambda - The callback for selector of web fragments, argument is jar name. (NotNull)public TomcatBoot configure(String configFile, String... extendsConfigFiles)
boot.configure("fortress_config.properties", "fortress_env.properties");
configFile - The path of configuration file in classpath. (NotNull)extendsConfigFiles - The paths of super configuration files. (NotNull, EmptyAllowed)public TomcatBoot logging(String loggingFile, Consumer<TomcatLoggingOption> opLambda)
boot.logging("tomcat_logging.properties", op -> {
op.replace("tomcat.log.name", "catalina_out");
}); // uses jdk14logger
loggingFile - The path of logging file in classpath. (NotNull)opLambda - The callback for logging option. (NotNull)public TomcatBoot atBaseDir(String baseDir)
baseDir - The base directory for Tomcat@setBaseDir(). (NotNull)public TomcatBoot valve(org.apache.catalina.Valve yourValve)
yourValve - The your valve. (NotNull)public TomcatBoot asYouLikeIt(LikeItCatalinaSetupper resourceLambda)
resourceLambda - The setupper of tomcat resource (e.g. host, context). (NotNull)public TomcatBoot bootAwait()
public void ready()
protected void loadServerConfigIfNeeds()
protected Properties readConfigProps(String propFile)
protected void loadServerLoggingIfNeeds()
public void go()
protected void prepareServer()
protected void adjustServer()
protected void setupWebappContext()
protected void doSetupWebappContextWar(String warPath) throws javax.servlet.ServletException
javax.servlet.ServletExceptionprotected void doSetupWebappContextWebappDir()
throws javax.servlet.ServletException
javax.servlet.ServletExceptionprotected org.apache.catalina.startup.Tomcat createTomcat()
protected RhythmicalTomcat newRhythmicalTomcat(BootLogger bootLogger, RhythmicalHandlingDef.AnnotationHandling annotationHandling, RhythmicalHandlingDef.MetaInfoResourceHandling metaInfoResourceHandling, RhythmicalHandlingDef.TldHandling tldHandling, Predicate<String> tldFilesSelector, RhythmicalHandlingDef.WebFragmentsHandling webFragmentsHandling, Predicate<String> webFragmentsSelector, AccessLogOption accessLogOption, YourValveOption yourValveOption, LikeItCatalinaSetupper likeitCatalinaSetupper)
protected RhythmicalHandlingDef.AnnotationHandling prepareAnnotationHandling()
protected RhythmicalHandlingDef.MetaInfoResourceHandling prepareMetaInfoResourceHandling()
protected RhythmicalHandlingDef.TldHandling prepareTldHandling()
protected RhythmicalHandlingDef.WebFragmentsHandling prepareuseWebFragmentsHandling()
protected AccessLogOption prepareAccessLogOption()
protected YourValveOption prepareYourValveOption()
protected LikeItCatalinaSetupper prepareLikeItCatalinaSetupper()
public void await()
protected String prepareWarPath()
protected String prepareWebappPath()
protected File deriveWebappDir()
protected String getBasicWebappRelativePath()
protected boolean isUnpackWARsDisabled()
protected void disableUnpackWARsOption()
protected void prepareUnpackWARsEnv()
protected void cleanPreviousExtractedWarDir(File appBaseFile)
protected void setupServerConfigIfNeeds()
protected URI startServer()
protected void registerShutdownHook()
protected File prepareMarkFile()
protected void waitForExistingServerShuwdown()
protected String buildMarkFilePath()
protected String getMarkDir()
protected boolean needsShutdown(File markFile, long lastModified)
protected void shutdownForcedly()
protected void waitForNextShuwdownHook()
protected long getShuwdownHookWaitMillis()
protected void browseOnDesktop(URI uri)
public void close()
protected void info(String msg)
public org.apache.catalina.startup.Tomcat getServer()
Copyright © 2015–2023 The DBFlute Project. All rights reserved.