Package com.linecorp.armeria.server
Interface HttpService
- All Superinterfaces:
Service<HttpRequest,
,HttpResponse> Unwrappable
- All Known Subinterfaces:
GraphqlService
,GrpcService
,HttpServiceWithRoutes
,TransientHttpService
- All Known Implementing Classes:
AbstractGraphqlService
,AbstractHttpService
,AbstractUnaryGrpcService
,AbstractUnsafeUnaryGrpcService
,AuthService
,BraveService
,ContentPreviewingService
,CoroutineContextService
,CorsService
,DecodingService
,DocService
,EncodingService
,FileService
,HealthCheckService
,JettyService
,LoggingService
,ManagementService
,MetricCollectingService
,ObservationService
,PrometheusExpositionService
,RedirectService
,ResteasyService
,SimpleDecoratingHttpService
,ThrottlingService
,THttpService
,TomcatService
,WebSocketService
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
An HTTP/2
Service
.-
Method Summary
Modifier and TypeMethodDescriptiondefault HttpService
decorate
(DecoratingHttpServiceFunction function) Creates a newHttpService
that decorates thisHttpService
with the specifiedDecoratingHttpServiceFunction
.decorate
(Function<? super HttpService, R> decorator) default ExchangeType
exchangeType
(RoutingContext routingContext) serve
(ServiceRequestContext ctx, HttpRequest req) Serves an incomingRequest
.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
-
serve
Description copied from interface:Service
Serves an incomingRequest
.- Specified by:
serve
in interfaceService<HttpRequest,
HttpResponse> - Parameters:
ctx
- the context of the receivedRequest
req
- the receivedRequest
- Returns:
- the
Response
- Throws:
Exception
-
decorate
default <R extends Service<R_I,R_O>, R decorateR_I extends Request, R_O extends Response> (Function<? super HttpService, R> decorator) -
decorate
Creates a newHttpService
that decorates thisHttpService
with the specifiedDecoratingHttpServiceFunction
. -
exchangeType
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.
-