Class TomcatConfiguration
java.lang.Object
org.apache.juneau.microservice.tomcat.TomcatConfiguration
Microservice bootstrap.
Add this class to configurations(...) to enable a
Tomcat-backed microservice:
Microservice
.
Contributes the following beans (each gated on @ConditionalOnMissingBean so user-supplied beans of the
same type win):
TomcatServerFactory— defaults toBasicTomcatServerFactory, used to build theTomcatinstance programmatically.TomcatSettings— empty defaults; user-supplied@Bean TomcatSettings can override ports and the Catalina base directory.TomcatServerComponent(always contributed, also registered underMicroserviceListener) — drives the Tomcat server lifecycle via the microservice'sstart()/stop()fan-out.
Rest.path() during start-up. See TomcatServerComponent for
full details.
See Also:
- Since:
- 10.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionContributes theTomcatServerComponentbean under its own type for direct lookup by external callers.Contributes the default Tomcat server factory used to build theTomcatinstance.Contributes the sameTomcatServerComponentinstance underMicroserviceListener(namedtomcatServerListener ) so it participates in theMicroservice.start()/Microservice.stop()fan-out without clobbering any user-supplied unnamedMicroserviceListener.Contributes an empty defaultTomcatSettingssoTomcatServerComponentalways finds one in the store.
-
Constructor Details
-
TomcatConfiguration
public TomcatConfiguration()Constructor.
-
-
Method Details
-
tomcatServerFactory
@ConditionalOnMissingBean(TomcatServerFactory.class) public TomcatServerFactory tomcatServerFactory()Contributes the default Tomcat server factory used to build theTomcatinstance.- Returns:
- The default factory.
-
tomcatSettings
Contributes an empty defaultTomcatSettingssoTomcatServerComponentalways finds one in the store. Users who need programmatic overrides supply their own@Bean TomcatSettings .- Returns:
- The default empty settings.
-
tomcatServerComponent
Contributes theTomcatServerComponentbean under its own type for direct lookup by external callers.- Returns:
- The component instance.
-
tomcatServerListener
Contributes the sameTomcatServerComponentinstance underMicroserviceListener(namedtomcatServerListener ) so it participates in theMicroservice.start()/Microservice.stop()fan-out without clobbering any user-supplied unnamedMicroserviceListener.- Returns:
- The component instance.
-