Class HttpJerseyRouterBuilder
- java.lang.Object
-
- io.servicetalk.http.router.jersey.HttpJerseyRouterBuilder
-
public final class HttpJerseyRouterBuilder extends java.lang.ObjectBuilds anStreamingHttpServicewhich routes requests to JAX-RS annotated classes, using Jersey as the routing engine, eg.final StreamingHttpService router = new HttpJerseyRouterBuilder() .buildStreaming(application);
-
-
Constructor Summary
Constructors Constructor Description HttpJerseyRouterBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpJerseyRouterBuilderbaseUriFunction(java.util.function.BiFunction<ConnectionContext,HttpRequestMetaData,java.lang.String> baseUriFunction)Set the function used to compute the base URI for the incoming HTTP request.HttpServicebuild(java.lang.Class<? extends javax.ws.rs.core.Application> applicationClass)Build theHttpServicefor the specified JAX-RSApplicationclass.HttpServicebuild(javax.ws.rs.core.Application application)Build theHttpServicefor the specified JAX-RSApplication.BlockingHttpServicebuildBlocking(java.lang.Class<? extends javax.ws.rs.core.Application> applicationClass)Build theBlockingHttpServicefor the specified JAX-RSApplicationclass.BlockingHttpServicebuildBlocking(javax.ws.rs.core.Application application)Build theBlockingHttpServicefor the specified JAX-RSApplication.BlockingStreamingHttpServicebuildBlockingStreaming(java.lang.Class<? extends javax.ws.rs.core.Application> applicationClass)Build theBlockingStreamingHttpServicefor the specified JAX-RSApplicationclass.BlockingStreamingHttpServicebuildBlockingStreaming(javax.ws.rs.core.Application application)Build theBlockingStreamingHttpServicefor the specified JAX-RSApplication.StreamingHttpServicebuildStreaming(java.lang.Class<? extends javax.ws.rs.core.Application> applicationClass)Build theStreamingHttpServicefor the specified JAX-RSApplicationclass.StreamingHttpServicebuildStreaming(javax.ws.rs.core.Application application)Build theStreamingHttpServicefor the specified JAX-RSApplication.HttpJerseyRouterBuilderpublisherInputStreamQueueCapacity(int publisherInputStreamQueueCapacity)Set the hint for the capacity of the intermediary queue that stores items when adaptingPublishers intoInputStreams.HttpJerseyRouterBuilderrouteExecutionStrategyFactory(RouteExecutionStrategyFactory<HttpExecutionStrategy> strategyFactory)Set aRouteExecutionStrategyFactory<HttpExecutionStrategy>for creatingHttpExecutionStrategyinstances that can be used for offloading the handling of request to resource methods, as specified viaRouteExecutionStrategyannotations.
-
-
-
Method Detail
-
publisherInputStreamQueueCapacity
public HttpJerseyRouterBuilder publisherInputStreamQueueCapacity(int publisherInputStreamQueueCapacity)
Set the hint for the capacity of the intermediary queue that stores items when adaptingPublishers intoInputStreams.- Parameters:
publisherInputStreamQueueCapacity- the capacity hint.- Returns:
- this
-
baseUriFunction
public HttpJerseyRouterBuilder baseUriFunction(java.util.function.BiFunction<ConnectionContext,HttpRequestMetaData,java.lang.String> baseUriFunction)
Set the function used to compute the base URI for the incoming HTTP request. The computed base URI must have/as path, and no query nor fragment.- Parameters:
baseUriFunction- aBiFunctionthat computes a base URIStringfor the providedConnectionContextandHttpRequestMetaData.- Returns:
- this
- See Also:
- URI Syntax Components
-
routeExecutionStrategyFactory
public HttpJerseyRouterBuilder routeExecutionStrategyFactory(RouteExecutionStrategyFactory<HttpExecutionStrategy> strategyFactory)
Set aRouteExecutionStrategyFactory<HttpExecutionStrategy>for creatingHttpExecutionStrategyinstances that can be used for offloading the handling of request to resource methods, as specified viaRouteExecutionStrategyannotations.- Parameters:
strategyFactory- aRouteExecutionStrategyFactory<HttpExecutionStrategy>- Returns:
- this
- See Also:
RouteExecutionStrategy
-
build
public HttpService build(javax.ws.rs.core.Application application)
Build theHttpServicefor the specified JAX-RSApplication.- Parameters:
application- theApplicationto route requests to.- Returns:
- the
HttpService.
-
build
public HttpService build(java.lang.Class<? extends javax.ws.rs.core.Application> applicationClass)
Build theHttpServicefor the specified JAX-RSApplicationclass.- Parameters:
applicationClass- theApplicationclass to instantiate and route requests to.- Returns:
- the
HttpService.
-
buildStreaming
public StreamingHttpService buildStreaming(javax.ws.rs.core.Application application)
Build theStreamingHttpServicefor the specified JAX-RSApplication.- Parameters:
application- theApplicationto route requests to.- Returns:
- the
StreamingHttpService.
-
buildStreaming
public StreamingHttpService buildStreaming(java.lang.Class<? extends javax.ws.rs.core.Application> applicationClass)
Build theStreamingHttpServicefor the specified JAX-RSApplicationclass.- Parameters:
applicationClass- theApplicationclass to instantiate and route requests to.- Returns:
- the
StreamingHttpService.
-
buildBlocking
public BlockingHttpService buildBlocking(javax.ws.rs.core.Application application)
Build theBlockingHttpServicefor the specified JAX-RSApplication.- Parameters:
application- theApplicationto route requests to.- Returns:
- the
BlockingHttpService.
-
buildBlocking
public BlockingHttpService buildBlocking(java.lang.Class<? extends javax.ws.rs.core.Application> applicationClass)
Build theBlockingHttpServicefor the specified JAX-RSApplicationclass.- Parameters:
applicationClass- theApplicationclass to instantiate and route requests to.- Returns:
- the
BlockingHttpService.
-
buildBlockingStreaming
public BlockingStreamingHttpService buildBlockingStreaming(javax.ws.rs.core.Application application)
Build theBlockingStreamingHttpServicefor the specified JAX-RSApplication.- Parameters:
application- theApplicationto route requests to.- Returns:
- the
BlockingStreamingHttpService.
-
buildBlockingStreaming
public BlockingStreamingHttpService buildBlockingStreaming(java.lang.Class<? extends javax.ws.rs.core.Application> applicationClass)
Build theBlockingStreamingHttpServicefor the specified JAX-RSApplicationclass.- Parameters:
applicationClass- theApplicationclass to instantiate and route requests to.- Returns:
- the
BlockingStreamingHttpService.
-
-