Class TomcatService
java.lang.Object
com.linecorp.armeria.server.tomcat.TomcatService
- All Implemented Interfaces:
Unwrappable
,HttpService
,Service<HttpRequest,HttpResponse>
public abstract class TomcatService extends Object implements HttpService
An
HttpService
that dispatches its requests to a web application running in an embedded
Tomcat.- See Also:
TomcatServiceBuilder
-
Method Summary
Modifier and Type Method Description static TomcatServiceBuilder
builder(File docBase)
Creates a newTomcatServiceBuilder
with the web application at the specified document base, which can be a directory or a JAR/WAR file.static TomcatServiceBuilder
builder(File rootDirOrDocBase, String relativePath)
Creates a newTomcatServiceBuilder
with the web application at the specified document base, which can be a directory or a JAR/WAR file.static TomcatServiceBuilder
builder(Path docBase)
Creates a newTomcatServiceBuilder
with the web application at the specified document base, which can be a directory or a JAR/WAR file.static TomcatServiceBuilder
builder(Path rootDirOrDocBase, String relativePath)
Creates a newTomcatServiceBuilder
with the web application at the specified document base, which can be a directory or a JAR/WAR file.abstract Connector
connector()
Returns TomcatConnector
.static TomcatService
of(File docBase)
Creates a newTomcatService
with the web application at the specified document base, which can be a directory or a JAR/WAR file.static TomcatService
of(File rootDir, String relativeDocBase)
Creates a newTomcatService
with the web application at the specified document base, which can be a directory or a JAR/WAR file.static TomcatService
of(Path docBase)
Creates a newTomcatService
with the web application at the specified document base, which can be a directory or a JAR/WAR file.static TomcatService
of(Path rootDir, String relativeDocBase)
Creates a newTomcatService
with the web application at the specified document base, which can be a directory or a JAR/WAR file.static TomcatService
of(Connector connector)
Creates a newTomcatService
from an existing TomcatConnector
instance.static TomcatService
of(Connector connector, String hostname)
Creates a newTomcatService
from an existing TomcatConnector
instance.static TomcatService
of(Tomcat tomcat)
Creates a newTomcatService
from an existingTomcat
instance.HttpResponse
serve(ServiceRequestContext ctx, HttpRequest req)
Serves an incomingRequest
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.linecorp.armeria.server.Service
as, serviceAdded, shouldCachePath, unwrap
-
Method Details
-
of
Creates a newTomcatService
with the web application at the specified document base, which can be a directory or a JAR/WAR file. -
of
Creates a newTomcatService
with the web application at the specified document base, which can be a directory or a JAR/WAR file. -
of
Creates a newTomcatService
with the web application at the specified document base, which can be a directory or a JAR/WAR file. -
of
Creates a newTomcatService
with the web application at the specified document base, which can be a directory or a JAR/WAR file. -
of
Creates a newTomcatService
from an existingTomcat
instance. If the specifiedTomcat
instance is not configured properly, the returnedTomcatService
may respond with '503 Service Not Available' error.- Returns:
- a new
TomcatService
, which will not manage the providedTomcat
instance.
-
of
Creates a newTomcatService
from an existing TomcatConnector
instance. If the specifiedConnector
instance is not configured properly, the returnedTomcatService
may respond with '503 Service Not Available' error.- Returns:
- a new
TomcatService
, which will not manage the providedConnector
instance.
-
of
Creates a newTomcatService
from an existing TomcatConnector
instance. If the specifiedConnector
instance is not configured properly, the returnedTomcatService
may respond with '503 Service Not Available' error.- Returns:
- a new
TomcatService
, which will not manage the providedConnector
instance.
-
builder
Creates a newTomcatServiceBuilder
with the web application at the specified document base, which can be a directory or a JAR/WAR file. -
builder
Creates a newTomcatServiceBuilder
with the web application at the specified document base, which can be a directory or a JAR/WAR file. -
builder
Creates a newTomcatServiceBuilder
with the web application at the specified document base, which can be a directory or a JAR/WAR file. -
builder
Creates a newTomcatServiceBuilder
with the web application at the specified document base, which can be a directory or a JAR/WAR file. -
connector
Returns TomcatConnector
. -
serve
Description copied from interface:Service
Serves an incomingRequest
.- Specified by:
serve
in interfaceHttpService
- Specified by:
serve
in interfaceService<HttpRequest,HttpResponse>
- Parameters:
ctx
- the context of the receivedRequest
req
- the receivedRequest
- Returns:
- the
Response
- Throws:
Exception
-