[seam-commits] Seam SVN: r11277 - branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/deployment.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Jul 13 07:55:09 EDT 2009


Author: manaRH
Date: 2009-07-13 07:55:08 -0400 (Mon, 13 Jul 2009)
New Revision: 11277

Added:
   branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/deployment/PagesDotXmlDeploymentHandler.java
Log:
back ported JBSEAM-4121 - fix the wrong placement of class PagesDotXmlDeploymentHandler

Copied: branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/deployment/PagesDotXmlDeploymentHandler.java (from rev 11271, branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/contexts/PagesDotXmlDeploymentHandler.java)
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/deployment/PagesDotXmlDeploymentHandler.java	                        (rev 0)
+++ branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/deployment/PagesDotXmlDeploymentHandler.java	2009-07-13 11:55:08 UTC (rev 11277)
@@ -0,0 +1,61 @@
+package org.jboss.seam.deployment;
+
+import org.jboss.seam.contexts.Contexts;
+
+/**
+ * The {@link PagesDotXmlDeploymentHandler} process pages.xml files
+ * Its only purpose is to make sure pages.xml gets updated by hot deploy
+ * 
+ * @author Stuart Douglas
+ * 
+ */
+public class PagesDotXmlDeploymentHandler extends AbstractDeploymentHandler
+{
+   
+   private static DeploymentMetadata PAGESDOTXML_SUFFIX_FILE_METADATA = new DeploymentMetadata()
+   {
+      
+      public String getFileNameSuffix()
+      {
+         return "WEB-INF/pages.xml";
+      }
+      
+   };
+   
+   /**
+    * Name under which this {@link DeploymentHandler} is registered
+    */
+   public static final String NAME = "org.jboss.seam.deployment.PagesDotXmlDeploymentHandler";
+   
+   public String getName()
+   {
+      return NAME;
+   }
+   
+   public static PagesDotXmlDeploymentHandler instance()
+   {
+      if (Contexts.isEventContextActive())
+      {
+         if (Contexts.getEventContext().isSet(WarRootDeploymentStrategy.NAME))
+         {
+            DeploymentStrategy deploymentStrategy = (DeploymentStrategy) Contexts.getEventContext().get(WarRootDeploymentStrategy.NAME);
+            Object deploymentHandler = deploymentStrategy.getDeploymentHandlers().get(NAME);
+            if (deploymentHandler != null)
+            {
+               return (PagesDotXmlDeploymentHandler) deploymentHandler;
+            }
+         }
+         return null;
+      }
+      else
+      {
+         throw new IllegalStateException("Event context not active");
+      }
+   }
+   
+   public DeploymentMetadata getMetadata()
+   {
+      return PAGESDOTXML_SUFFIX_FILE_METADATA;
+   }
+   
+}




More information about the seam-commits mailing list