org.jboss.aerogear.controller.router.rest.pagination
Class PaginationHandler
java.lang.Object
org.jboss.aerogear.controller.router.rest.pagination.PaginationHandler
- All Implemented Interfaces:
- RouteProcessor
@Decorator
public class PaginationHandler
- extends Object
- implements RouteProcessor
PaginationHandler is a CDI Decorator that decorates a RouteProcessor and is responsible for handling
paginated invocations on endpoints that support it.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
delegate
private final RouteProcessor delegate
pagingStrategy
private final PaginationStrategy pagingStrategy
consumers
private final Map<String,Consumer> consumers
endpointInvoker
private final EndpointInvoker endpointInvoker
PaginationHandler
@Inject
public PaginationHandler(@Delegate
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.
- Parameters:
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.
process
public InvocationResult process(RouteContext routeContext)
throws Exception
- Description copied from interface:
RouteProcessor
- Handles the actual invocation of the target or the passed-in
Route.
- Specified by:
process in interface RouteProcessor
- Parameters:
routeContext - the RouteContext for the current request.
- Throws:
Exception - if processing of the route causes an exception.
hasPaginatedAnnotation
private boolean hasPaginatedAnnotation(Route route)
defaultPagingStrategy
public static PaginationStrategy defaultPagingStrategy()
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.