Class TomcatService
java.lang.Object
com.linecorp.armeria.server.tomcat.TomcatService
- All Implemented Interfaces:
Unwrappable
,HttpService
,Service<HttpRequest,
HttpResponse>
An
HttpService
that dispatches its requests to a web application running in an embedded
Tomcat.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic TomcatServiceBuilder
Creates a newTomcatServiceBuilder
with the web application at the specified document base, which can be a directory or a JAR/WAR file.static TomcatServiceBuilder
Creates a newTomcatServiceBuilder
with the web application at the specified document base, which can be a directory or a JAR/WAR file.static TomcatServiceBuilder
Creates a newTomcatServiceBuilder
with the web application at the specified document base, which can be a directory or a JAR/WAR file.static TomcatServiceBuilder
Creates a newTomcatServiceBuilder
with the web application at the specified document base, which can be a directory or a JAR/WAR file.Returns TomcatConnector
.exchangeType
(RoutingContext routingContext) static TomcatService
Creates a newTomcatService
with the web application at the specified document base, which can be a directory or a JAR/WAR file.static TomcatService
Creates a newTomcatService
with the web application at the specified document base, which can be a directory or a JAR/WAR file.static TomcatService
Creates a newTomcatService
with the web application at the specified document base, which can be a directory or a JAR/WAR file.static TomcatService
Creates a newTomcatService
with the web application at the specified document base, which can be a directory or a JAR/WAR file.static TomcatService
Creates a newTomcatService
from an existing TomcatConnector
instance.static TomcatService
Creates a newTomcatService
from an existing TomcatConnector
instance.static TomcatService
Creates a newTomcatService
from an existingTomcat
instance.final 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.HttpService
decorate, decorate
Methods inherited from interface com.linecorp.armeria.server.Service
as, serviceAdded, shouldCachePath, unwrap
Methods inherited from interface com.linecorp.armeria.common.util.Unwrappable
equalsIgnoreWrapper, unwrapAll
-
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
-
exchangeType
Description copied from interface:HttpService
Determines anExchangeType
for thisHttpService
from the givenRoutingContext
. By default,ExchangeType.BIDI_STREAMING
is set.Note that an
HttpRequest
will be aggregated before serving theHttpService
ifExchangeType.UNARY
orExchangeType.RESPONSE_STREAMING
is set.- Specified by:
exchangeType
in interfaceHttpService
-