portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r331563 - /portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java
Date Mon, 07 Nov 2005 18:11:58 GMT
Author: taylor
Date: Mon Nov  7 10:11:56 2005
New Revision: 331563

URL: http://svn.apache.org/viewcvs?rev=331563&view=rev
Log:
http://issues.apache.org/jira/browse/JS2-362

having some timing issues on a slower machine
give spring a chance to init

Modified:
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java?rev=331563&r1=331562&r2=331563&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java
Mon Nov  7 10:11:56 2005
@@ -134,9 +134,21 @@
 
         // get jetspeed component manager configuration for decorations
         ComponentManager cm = Jetspeed.getComponentManager();
-        if (null == cm)  // TODO: retry loop 
-            throw new ServletException("Could not get Jetspeed Component Manager");
+        int count =0;
+        while(cm == null) {
+            try {
+                Thread.sleep(200);
+            } catch(InterruptedException ie) {
+                
+            }
+            cm = Jetspeed.getComponentManager();
+            if( count > 5 ) {
+                if (null == cm)
+                    throw new ServletException("Could not get Jetspeed Component Manager
after "+count+"tries");
+            }
+            count++;
         
+        }
         decorationLocator = (TemplateLocator) cm.getComponent("DecorationLocator");
 
         // initialize thread safe velocity engine cache



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message