Package org.sonatype.nexus.componentviews.Router

Examples of org.sonatype.nexus.componentviews.Router.Route


  private final ViewConfig config;

  public View(final ViewConfig config, final Router router, final Handler handlerOfLastResort) {
    this.router = checkNotNull(router);
    this.config = checkNotNull(config);
    this.routeOfLastResort = new Route(new AllRequestMatcher(), asList(handlerOfLastResort));
  }
View Full Code Here


  }

  public ViewResponse dispatch(final ViewRequest request) {
    final HandlerContext context = new HandlerContext(request);

    final Route route = router.findRoute(context);

    try {
      if (route == null) {
        log.debug("No route found for request.");
        return routeOfLastResort.dispatch(context);
      }

      return route.dispatch(context);
    }
    catch (Exception e) {
      // Exceptions will get caught by a global filter and nicely reported as 500 errors.
      throw Throwables.propagate(e);
    }
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.componentviews.Router.Route

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.