Пример #1
0
 /**
  * In PROD mode and if the routes are already loaded, this does nothing.
  *
  * <p>
  *
  * <p>In DEV mode, this checks each routes file's "last modified" time to see if the routes need
  * updated.
  *
  * @param prefix The prefix that the path of all routes in this route file start with. This prefix
  *     should not end with a '/' character.
  */
 public static void detectChanges(String prefix) {
   if (Play.mode == Mode.PROD && lastLoading > 0) {
     return;
   }
   if (Play.routes.lastModified() > lastLoading) {
     load(prefix);
   } else {
     for (VirtualFile file : Play.modulesRoutes.values()) {
       if (file.lastModified() > lastLoading) {
         load(prefix);
         return;
       }
     }
   }
 }
Пример #2
0
 private static synchronized void loadRouter(String contextPath) {
   // Reload the rules, but this time with the context. Not really efficient through...
   // Servlet 2.4 does not allow you to get the context path from the servletcontext...
   if (routerInitializedWithContext) return;
   Play.ctxPath = contextPath;
   Router.load(contextPath);
   routerInitializedWithContext = true;
 }
Пример #3
0
 private void loadRouter(String contextPath) {
   Play.ctxPath = contextPath;
   Router.load(contextPath);
   routerInitializedWithContext = true;
 }