org.jboss.aerogear.controller.router
Class DefaultRouteProcessor
java.lang.Object
org.jboss.aerogear.controller.router.DefaultRouteProcessor
- All Implemented Interfaces:
- RouteProcessor
public class DefaultRouteProcessor
- extends Object
- implements RouteProcessor
Default implementation of RouteProcessor.
This implementation uses Context and Dependency Injection (CDI) to have various parts injected into it. Of
particular interest for end users is the RoutingModule which is described in more detail in the section below.
RoutingModule
The CDI implementation will scan for an instance of RoutingModule upon deployment, and its
RoutingModule.build() method will be called to assemble the routes configured for this application.
To simplify this process AbstractRoutingModule is provided, please refer its javadoc for sample usage.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
beanManager
private javax.enterprise.inject.spi.BeanManager beanManager
iogi
private final br.com.caelum.iogi.Iogi iogi
controllerFactory
private ControllerFactory controllerFactory
responders
private Set<Responder> responders
DefaultRouteProcessor
public DefaultRouteProcessor()
DefaultRouteProcessor
@Inject
public DefaultRouteProcessor(javax.enterprise.inject.spi.BeanManager beanManager,
javax.enterprise.inject.Instance<Responder> responders,
ControllerFactory controllerFactory)
process
public void 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.
respond
private boolean respond(String mediaType,
Object result,
RouteContext routeContext)
throws Exception
- Throws:
Exception
extractPathParameters
private Object[] extractPathParameters(String requestPath,
Route route)
extractParameters
private Object[] extractParameters(javax.servlet.http.HttpServletRequest request,
Route route)
getController
private Object getController(Route route)
Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.