Package com.linecorp.armeria.server
Interface HttpService
- All Superinterfaces:
Service<HttpRequest,HttpResponse>,Unwrappable
- All Known Subinterfaces:
GraphqlService,GrpcService,HttpServiceWithRoutes,TransientHttpService
- All Known Implementing Classes:
AbstractHttpService,AbstractUnaryGrpcService,AbstractUnsafeUnaryGrpcService,AuthService,BraveService,ContentPreviewingService,CoroutineContextService,CorsService,DecodingService,DocService,EncodingService,FileService,HealthCheckService,JettyService,LoggingService,ManagementService,MetricCollectingService,PrometheusExpositionService,RedirectService,ResteasyService,SimpleDecoratingHttpService,ThrottlingService,THttpService,TomcatService
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface HttpService extends Service<HttpRequest,HttpResponse>
An HTTP/2
Service.-
Method Summary
Modifier and Type Method Description default HttpServicedecorate(DecoratingHttpServiceFunction function)Creates a newHttpServicethat decorates thisHttpServicewith the specifiedDecoratingHttpServiceFunction.default <R extends Service<R_I, R_O>, R_I extends Request, R_O extends Response>
Rdecorate(Function<? super HttpService,R> decorator)HttpResponseserve(ServiceRequestContext ctx, HttpRequest req)Serves an incomingRequest.Methods inherited from interface com.linecorp.armeria.server.Service
as, serviceAdded, shouldCachePath, unwrap
-
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_I extends Request, R_O extends Response> R decorate(Function<? super HttpService,R> decorator) -
decorate
Creates a newHttpServicethat decorates thisHttpServicewith the specifiedDecoratingHttpServiceFunction.
-