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 HttpServicedecorate(DecoratingHttpServiceFunction function) Creates a newHttpServicethat decorates thisHttpServicewith the specifiedDecoratingHttpServiceFunction.decorate(Function<? super HttpService, R> decorator) default ExchangeTypeexchangeType(RoutingContext routingContext) serve(ServiceRequestContext ctx, HttpRequest req) Serves an incomingRequest.Methods inherited from interface com.linecorp.armeria.server.Service
as, serviceAdded, shouldCachePath, unwrapMethods inherited from interface com.linecorp.armeria.common.util.Unwrappable
equalsIgnoreWrapper, unwrapAll
-
Method Details
-
serve
Description copied from interface:ServiceServes an incomingRequest.- Specified by:
servein interfaceService<HttpRequest,HttpResponse> - Parameters:
ctx- the context of the receivedRequestreq- 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 newHttpServicethat decorates thisHttpServicewith the specifiedDecoratingHttpServiceFunction. -
exchangeType
Determines anExchangeTypefor thisHttpServicefrom the givenRoutingContext. By default,ExchangeType.BIDI_STREAMINGis set.Note that an
HttpRequestwill be aggregated before serving theHttpServiceifExchangeType.UNARYorExchangeType.RESPONSE_STREAMINGis set.
-