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 HttpService
decorate(DecoratingHttpServiceFunction function)
Creates a newHttpService
that decorates thisHttpService
with the specifiedDecoratingHttpServiceFunction
.default <R extends Service<R_I, R_O>, R_I extends Request, R_O extends Response>
Rdecorate(Function<? super HttpService,R> decorator)
HttpResponse
serve(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: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_I extends Request, R_O extends Response> R decorate(Function<? super HttpService,R> decorator) -
decorate
Creates a newHttpService
that decorates thisHttpService
with the specifiedDecoratingHttpServiceFunction
.
-