Package com.bobocode.bring.web.server
Interface ServletWebServerFactory
- All Known Implementing Classes:
TomcatServletWebServerFactory
public interface ServletWebServerFactory
A factory interface for creating and configuring servlet-based web servers.
Implementations of this interface provide methods to create a
WebServer
instance and obtain information about the server's context and context path.
This interface is designed to be implemented by classes that create and configure embedded servlet containers, such as Apache Tomcat.
- Since:
- 1.0
- Author:
- Blyzhnytsia Team
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.catalina.Context
Returns theContext
associated with the servlet-based web server.Returns the context path for the servlet-based web server.Creates and returns a new instance of a servlet-basedWebServer
.void
setTomcatAppLifecycleListener
(org.apache.catalina.LifecycleListener tomcatAppLifecycleListener)
-
Method Details
-
getWebServer
WebServer getWebServer()Creates and returns a new instance of a servlet-basedWebServer
.- Returns:
- a configured instance of
WebServer
- See Also:
-
getContext
org.apache.catalina.Context getContext()Returns theContext
associated with the servlet-based web server.- Returns:
- the server's
Context
- See Also:
-
getContextPath
String getContextPath()Returns the context path for the servlet-based web server.- Returns:
- the context path
-
setTomcatAppLifecycleListener
void setTomcatAppLifecycleListener(org.apache.catalina.LifecycleListener tomcatAppLifecycleListener)
-