aerogear-controller 1.0.1

org.jboss.aerogear.controller.router.rest.pagination
Class PaginationHandler

java.lang.Object
  extended by 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.


Field Summary
private  Map<String,Consumer> consumers
           
private  RouteProcessor delegate
           
private  EndpointInvoker endpointInvoker
           
private  PaginationStrategy pagingStrategy
           
 
Constructor Summary
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.
 
Method Summary
static PaginationStrategy defaultPagingStrategy()
           
private  boolean hasPaginatedAnnotation(Route route)
           
 InvocationResult process(RouteContext routeContext)
          Handles the actual invocation of the target or the passed-in Route.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegate

private final RouteProcessor delegate

pagingStrategy

private final PaginationStrategy pagingStrategy

consumers

private final Map<String,Consumer> consumers

endpointInvoker

private final EndpointInvoker endpointInvoker
Constructor Detail

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.
Method Detail

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()

aerogear-controller 1.0.1

Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.