[seam-commits] Seam SVN: r11991 - branches/community/Seam_2_2/src/main/org/jboss/seam/init.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Jan 26 07:11:29 EST 2010


Author: manaRH
Date: 2010-01-26 07:11:29 -0500 (Tue, 26 Jan 2010)
New Revision: 11991

Modified:
   branches/community/Seam_2_2/src/main/org/jboss/seam/init/Initialization.java
Log:
JBSEAM-4334

Modified: branches/community/Seam_2_2/src/main/org/jboss/seam/init/Initialization.java
===================================================================
--- branches/community/Seam_2_2/src/main/org/jboss/seam/init/Initialization.java	2010-01-25 23:55:21 UTC (rev 11990)
+++ branches/community/Seam_2_2/src/main/org/jboss/seam/init/Initialization.java	2010-01-26 12:11:29 UTC (rev 11991)
@@ -755,93 +755,89 @@
          return;
       }
       
-      ReentrantLock lock = new ReentrantLock();
-      if (lock.tryLock(500, TimeUnit.MILLISECONDS))
+      try
       {
-         try
+         hotDeploymentStrategy = createHotDeployment(Thread.currentThread().getContextClassLoader(), isHotDeployEnabled(init));
+         
+         boolean changed = new TimestampCheckForwardingDeploymentStrategy()
          {
-            hotDeploymentStrategy = createHotDeployment(Thread.currentThread().getContextClassLoader(), isHotDeployEnabled(init));
-            
-            boolean changed = new TimestampCheckForwardingDeploymentStrategy()
+            @Override
+            protected DeploymentStrategy delegate()
             {
-               @Override
-               protected DeploymentStrategy delegate()
-               {
-                  return hotDeploymentStrategy;
-               }
-               
-            }.changedSince(init.getTimestamp());
+               return hotDeploymentStrategy;
+            }
             
-            if (hotDeploymentStrategy.available() && changed)
+         }.changedSince(init.getTimestamp());
+         
+         if (hotDeploymentStrategy.available() && changed)
+         {
+            ServletLifecycle.beginReinitialization(request);
+            Contexts.getEventContext().set(HotDeploymentStrategy.NAME, hotDeploymentStrategy);
+            hotDeploymentStrategy.scan();
+            
+            if (hotDeploymentStrategy.getTimestamp() > init.getTimestamp())
             {
-               ServletLifecycle.beginReinitialization(request);
-               Contexts.getEventContext().set(HotDeploymentStrategy.NAME, hotDeploymentStrategy);
-               hotDeploymentStrategy.scan();
-               
-               if (hotDeploymentStrategy.getTimestamp() > init.getTimestamp())
+               log.debug("redeploying components");
+               Seam.clearComponentNameCache();
+               for ( String name: init.getHotDeployableComponents() )
                {
-                  log.debug("redeploying components");
-                  Seam.clearComponentNameCache();
-                  for ( String name: init.getHotDeployableComponents() )
+                  Component component = Component.forName(name);
+                  if (component!=null)
                   {
-                     Component component = Component.forName(name);
-                     if (component!=null)
+                     ScopeType scope = component.getScope();
+                     if ( scope!=ScopeType.STATELESS && scope.isContextActive() )
                      {
-                        ScopeType scope = component.getScope();
-                        if ( scope!=ScopeType.STATELESS && scope.isContextActive() )
-                        {
-                           scope.getContext().remove(name);
-                        }
-                        init.removeObserverMethods(component);
+                        scope.getContext().remove(name);
                      }
-                     Contexts.getApplicationContext().remove(name + COMPONENT_SUFFIX);
+                     init.removeObserverMethods(component);
                   }
-               
-                  init.getHotDeployableComponents().clear();
-                  installHotDeployableComponents();
-                  installComponents(init);
-                  log.debug("done redeploying components");
+                  Contexts.getApplicationContext().remove(name + COMPONENT_SUFFIX);
                }
-               // update the timestamp outside of the second timestamp check to be sure we don't cause an unnecessary scan
-               // the second scan checks annotations (the slow part) which might happen to exclude the most recent file
-               init.setTimestamp(System.currentTimeMillis());
-               ServletLifecycle.endReinitialization();
+            
+               init.getHotDeployableComponents().clear();
+               installHotDeployableComponents();
+               installComponents(init);
+               log.debug("done redeploying components");
             }
-               
-            final WarRootDeploymentStrategy warRootDeploymentStrategy = new WarRootDeploymentStrategy(Thread.currentThread().getContextClassLoader(), warRoot, new File[] { warClassesDirectory, warLibDirectory, hotDeployDirectory });
-            changed = new TimestampCheckForwardingDeploymentStrategy()
+            // update the timestamp outside of the second timestamp check to be sure we don't cause an unnecessary scan
+            // the second scan checks annotations (the slow part) which might happen to exclude the most recent file
+            init.setTimestamp(System.currentTimeMillis());
+            ServletLifecycle.endReinitialization();
+         }
+            
+         final WarRootDeploymentStrategy warRootDeploymentStrategy = new WarRootDeploymentStrategy(Thread.currentThread().getContextClassLoader(), warRoot, new File[] { warClassesDirectory, warLibDirectory, hotDeployDirectory });
+         changed = new TimestampCheckForwardingDeploymentStrategy()
+         {
+            @Override
+            protected DeploymentStrategy delegate()
             {
-               @Override
-               protected DeploymentStrategy delegate()
-               {
-                  return warRootDeploymentStrategy;
-               }
-               
-            }.changedSince(init.getWarTimestamp());
-            if (changed)
+               return warRootDeploymentStrategy;
+            }
+            
+         }.changedSince(init.getWarTimestamp());
+         if (changed)
+         {
+            warRootDeploymentStrategy.scan();
+            if (warRootDeploymentStrategy.getTimestamp() > init.getWarTimestamp())
             {
-               warRootDeploymentStrategy.scan();
-               if (warRootDeploymentStrategy.getTimestamp() > init.getWarTimestamp())
-               {
-                  log.debug("redeploying page descriptors...");
-                  Pages pages = (Pages) ServletLifecycle.getServletContext().getAttribute(Seam.getComponentName(Pages.class));
-                  if (pages != null) {
-                     // application context is needed for creating expressions
-                     Lifecycle.setupApplication();
-                     pages.initialize(warRootDeploymentStrategy.getDotPageDotXmlFileNames());
-                     Lifecycle.cleanupApplication();
-                  }
-                  ServletLifecycle.getServletContext().removeAttribute(Seam.getComponentName(Exceptions.class));
-                  init.setWarTimestamp(warRootDeploymentStrategy.getTimestamp());
-                  log.debug ("done redeploying page descriptors");
+               log.debug("redeploying page descriptors...");
+               Pages pages = (Pages) ServletLifecycle.getServletContext().getAttribute(Seam.getComponentName(Pages.class));
+               if (pages != null) {
+                  // application context is needed for creating expressions
+                  Lifecycle.setupApplication();
+                  pages.initialize(warRootDeploymentStrategy.getDotPageDotXmlFileNames());
+                  Lifecycle.cleanupApplication();
                }
+               ServletLifecycle.getServletContext().removeAttribute(Seam.getComponentName(Exceptions.class));
+               init.setWarTimestamp(warRootDeploymentStrategy.getTimestamp());
+               log.debug ("done redeploying page descriptors");
             }
          }
-         finally
-         {
-            lock.unlock();
-         }
       }
+      finally
+      {
+         
+      }
    }
 
    private void installHotDeployableComponents()



More information about the seam-commits mailing list