cmailleux    2005/03/01 17:56:50 CET

  Modified files:        (Branch: JAHIA-4-1-BRANCH)
    src/java/org/jahia/operations OperationManager.java 
  Log:
  Merge with Branch 4-0

  Recursive call roll back to loop to avoid stackoverflowerror and enlarge the 
scope of try cache when generating page
  
  Revision      Changes    Path
  1.34.2.2.2.2  +11 -9     
jahia/src/java/org/jahia/operations/OperationManager.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/src/java/org/jahia/operations/OperationManager.java.diff?r1=1.34.2.2.2.1&r2=1.34.2.2.2.2&f=h
  
  
  
  Index: OperationManager.java
  ===================================================================
  RCS file: 
/home/cvs/repository/jahia/src/java/org/jahia/operations/Attic/OperationManager.java,v
  retrieving revision 1.34.2.2.2.1
  retrieving revision 1.34.2.2.2.2
  diff -u -r1.34.2.2.2.1 -r1.34.2.2.2.2
  --- OperationManager.java     24 Feb 2005 13:24:19 -0000      1.34.2.2.2.1
  +++ OperationManager.java     1 Mar 2005 16:56:50 -0000       1.34.2.2.2.2
  @@ -169,6 +169,7 @@
                   }
               }
               // logger.debug("Engine=" + engineName);
  +            while(true) {
               if (theEngine.needsJahiaData(jParams)) {
   
                   // logger.debug("Engine need JahiaData");
  @@ -279,6 +280,7 @@
                       haveToBeenGenerate = true;
               }
               if (haveToBeenGenerate) {
  +                try {
                   if( logger.isDebugEnabled()) {
                       logger.debug("We generate page "+entryKey);
   //                logger.debug("Cache mode "+jParams.getCacheStatus()+" 
original cache "+jParams.getOriginalCacheStatus());
  @@ -293,12 +295,7 @@
                   // for JSp
                   
jParams.getRequest().setAttribute("org.jahia.data.JahiaData", jData);
   
  -                try {
  -                    theEngine.handleActions(jParams, jData);
  -                } catch (Throwable e) {
  -                    generatingPage.remove(entryKey);
  -                    throw new JahiaException("Error during handle of 
operation","Error during handle of 
operation",JahiaException.PAGE_ERROR,JahiaException.ERROR_SEVERITY,e);
  -                }
  +                theEngine.handleActions(jParams, jData);
                   logger.debug("Operation handled for engine " + engineName);
   
                   HttpSession session = jParams.getRequest().getSession();
  @@ -311,18 +308,23 @@
   
                   // destroys request-dependant objects
                   jData = null;
  +                break;
  +                    } catch (Throwable e) {
  +                    generatingPage.remove(entryKey);
  +                    throw new JahiaException("Error during handle of 
operation","Error during handle of 
operation",JahiaException.PAGE_ERROR,JahiaException.ERROR_SEVERITY,e);
  +                }
               } else if(!haveToBeenGenerate && iscacheable) {
                   try {
                       Thread.sleep(2000);
                   } catch (InterruptedException e) {
                       logger.error("Exception during sleep ", e);
                   }
  -                this.handleOperations(jParams, jSettings);
  -                return;
  +            }
               }
           } else {
               logger.debug("Could not get the engine [" + engineName + "] 
instance.");
           }
  +
           try {
               // Let's retrieve the generated content from the response 
wrapper object.
               String generatedOutput = jParams.getGeneratedOutput();
  @@ -379,7 +381,7 @@
                                  int workflowState, String languageCode,
                                  String generatedOutput, String contentType) {
           logger.debug ("Storing generated content into the HTML Cache...");
  -        // Modified getOriginalCacheStatus to cacheStatus 
  +        // Modified getOriginalCacheStatus to cacheStatus
           if (("core".equals (jParams.getEngine ())) &&
                   ((ParamBean.CACHE_ON.equals 
(jParams.getOriginalCacheStatus() )) ||
                   (ParamBean.CACHE_ONLYUPDATE.equals 
(jParams.getOriginalCacheStatus() )) ||
  

Reply via email to