@Decorator public class PaginationHandler extends Object implements RouteProcessor
RouteProcessor and is responsible for handling
paginated invocations on endpoints that support it.| Modifier and Type | Field and Description |
|---|---|
private Map<String,Consumer> |
consumers |
private RouteProcessor |
delegate |
private EndpointInvoker |
endpointInvoker |
private PaginationStrategy |
pagingStrategy |
| Constructor and Description |
|---|
PaginationHandler(RouteProcessor delegate,
javax.enterprise.inject.Instance<PaginationStrategy> pagingStrategies,
javax.enterprise.inject.Instance<Consumer> consumers,
EndpointInvoker endpointInvoker)
Sole contructor which will have its parameters injected by CDI.
|
| Modifier and Type | Method and Description |
|---|---|
static PaginationStrategy |
defaultPagingStrategy() |
private boolean |
hasPaginatedAnnotation(Route route) |
InvocationResult |
process(RouteContext routeContext)
Handles the actual invocation of the target or the passed-in
Route. |
private final RouteProcessor delegate
private final PaginationStrategy pagingStrategy
private final EndpointInvoker endpointInvoker
@Inject
public PaginationHandler(@Delegate
RouteProcessor delegate,
javax.enterprise.inject.Instance<PaginationStrategy> pagingStrategies,
javax.enterprise.inject.Instance<Consumer> consumers,
EndpointInvoker endpointInvoker)
delegate - the RouteProcessor that this class decorates.pagingStrategies - a CDI Instance of PaginationStrategys enabling the strategy to be configured.consumers - CDI Instance of Consumer that are used for unmarshalling a HTTP request body into
a Java Object representation.endpointInvoker - EndpointInvoker which is responsible for invoking endpoints.public InvocationResult process(RouteContext routeContext) throws Exception
RouteProcessorRoute.process in interface RouteProcessorrouteContext - the RouteContext for the current request.Exception - if processing of the route causes an exception.private boolean hasPaginatedAnnotation(Route route)
public static PaginationStrategy defaultPagingStrategy()
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.