コード例 #1
0
ファイル: Router.java プロジェクト: heaphy/playframework
 /**
  * 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
ファイル: ServletWrapper.java プロジェクト: raff/play
 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
ファイル: ServletWrapper.java プロジェクト: GuyMograbi/play
 private void loadRouter(String contextPath) {
   Play.ctxPath = contextPath;
   Router.load(contextPath);
   routerInitializedWithContext = true;
 }