use of org.webpieces.router.impl.model.L1AllRouting in project webpieces by deanhiller.
the class RouteLoader method fetchInternalErrorRoute.
public RouteMeta fetchInternalErrorRoute(String domain) {
L1AllRouting routerInfo = routerBuilder.getRouterInfo();
RouteMeta internalErrorRoute = routerInfo.getInternalErrorRoute(domain);
return internalErrorRoute;
}
use of org.webpieces.router.impl.model.L1AllRouting in project webpieces by deanhiller.
the class RouteLoader method fetchRoute.
public MatchResult fetchRoute(RouterRequest req) {
L1AllRouting allRoutingInfo = routerBuilder.getRouterInfo();
MatchResult meta = allRoutingInfo.fetchRoute(req, req.relativePath);
if (meta == null)
throw new IllegalStateException("missing exception on creation if we go this far");
return meta;
}
use of org.webpieces.router.impl.model.L1AllRouting in project webpieces by deanhiller.
the class RouteLoader method loadAllRoutes.
//protected abstract void verifyRoutes(Collection<Route> allRoutes);
public void loadAllRoutes(WebAppMeta rm, Injector injector) {
log.info("adding routes");
ReverseRoutes reverseRoutes = new ReverseRoutes(config);
//routerBuilder = new RouterBuilder("", new AllRoutingInfo(), reverseRoutes, controllerFinder, config.getUrlEncoding());
LogicHolder holder = new LogicHolder(reverseRoutes, controllerFinder, injector, config);
routerBuilder = new R1RouterBuilder(new RouterInfo(null, ""), new L1AllRouting(), holder, false);
invoker.init(reverseRoutes);
List<Routes> all = new ArrayList<>();
//the core application routes
all.addAll(rm.getRouteModules());
List<Plugin> plugins = rm.getPlugins();
if (plugins != null) {
for (Plugin plugin : plugins) {
all.addAll(plugin.getRouteModules());
}
}
for (Routes module : all) {
AbstractRouteBuilder.currentPackage.set(new RouteModuleInfo(module));
module.configure(routerBuilder);
AbstractRouteBuilder.currentPackage.set(null);
}
log.info("added all routes to router. Applying Filters");
reverseRoutes.finalSetup();
routerBuilder.applyFilters(rm);
Collection<RouteMeta> metas = reverseRoutes.getAllRouteMetas();
for (RouteMeta m : metas) {
controllerFinder.loadFiltersIntoMeta(m, m.getFilters(), true);
}
routerBuilder.loadNotFoundAndErrorFilters();
log.info("all filters applied");
compressionCacheSetup.setupCache(routerBuilder.getStaticRoutes());
}
use of org.webpieces.router.impl.model.L1AllRouting in project webpieces by deanhiller.
the class RouteLoader method fetchNotFoundRoute.
public RouteMeta fetchNotFoundRoute(String domain) {
L1AllRouting routerInfo = routerBuilder.getRouterInfo();
RouteMeta notfoundRoute = routerInfo.getPageNotfoundRoute(domain);
return notfoundRoute;
}
Aggregations