[jboss-cvs] JBossAS SVN: r66630 - in projects/aop/trunk: asintegration/src/main/org/jboss/aop/deployers and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Oct 31 16:34:29 EDT 2007


Author: kabir.khan at jboss.com
Date: 2007-10-31 16:34:29 -0400 (Wed, 31 Oct 2007)
New Revision: 66630

Added:
   projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployers/AspectAppParsingDeployer.java
   projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployers/AspectDeployment.java
Modified:
   projects/aop/trunk/asintegration/.classpath
   projects/aop/trunk/build/build-release.xml
Log:
[JBAOP-366] Create AspectAppParsingDeployer to read the loader-repository element of top-level .aop deployment and populate the VFSDeploymentUnit's LoaderRepositoryConfig attachment if required so that the .aop deployment belongs to the same domain as the deployment we want to attach to

Modified: projects/aop/trunk/asintegration/.classpath
===================================================================
--- projects/aop/trunk/asintegration/.classpath	2007-10-31 20:32:15 UTC (rev 66629)
+++ projects/aop/trunk/asintegration/.classpath	2007-10-31 20:34:29 UTC (rev 66630)
@@ -25,5 +25,6 @@
 	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-client-spi.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-container-metadata.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-impl.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-managed.jar"/>
 	<classpathentry kind="output" path="output/eclipse-classes"/>
 </classpath>

Added: projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployers/AspectAppParsingDeployer.java
===================================================================
--- projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployers/AspectAppParsingDeployer.java	                        (rev 0)
+++ projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployers/AspectAppParsingDeployer.java	2007-10-31 20:34:29 UTC (rev 66630)
@@ -0,0 +1,75 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.aop.deployers;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.vfs.spi.deployer.JAXPDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.mx.loading.LoaderRepositoryFactory;
+import org.jboss.mx.loading.LoaderRepositoryFactory.LoaderRepositoryConfig;
+import org.jboss.virtual.VirtualFile;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/**
+ * Deployer to read the loader-repository config from a .aop/META-INF/jboss-aop.xml
+ * and populate the LoaderRepositoryConfig attachment. The main use-case is when 
+ * deploying a standalone .aop file that we want to attach to a scoped deployment.
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AspectAppParsingDeployer extends JAXPDeployer<AspectDeployment>
+{
+   public AspectAppParsingDeployer()
+   {
+      super(AspectDeployment.class);
+      setSuffix("-aop.xml");
+      setStage(DeploymentStages.DESCRIBE);
+   }
+
+   protected AspectDeployment parse(VFSDeploymentUnit unit, VirtualFile file, Document document) throws Exception
+   {
+      if (unit.getTopLevel() == unit)
+      {
+         // Check for a custom loader-repository for scoping
+         NodeList loaders = document.getElementsByTagName("loader-repository");
+         if( loaders.getLength() > 0 )
+         {
+            Element loader = (Element) loaders.item(0);
+            try
+            {
+               LoaderRepositoryConfig config = LoaderRepositoryFactory.parseRepositoryConfig(loader);
+               unit.addAttachment(LoaderRepositoryConfig.class, config);
+            }
+            catch (Exception e)
+            {
+               throw DeploymentException.rethrowAsDeploymentException("Unable to parse loader repository config", e);
+            }
+         }
+      }
+      return null;
+   }
+
+}

Added: projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployers/AspectDeployment.java
===================================================================
--- projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployers/AspectDeployment.java	                        (rev 0)
+++ projects/aop/trunk/asintegration/src/main/org/jboss/aop/deployers/AspectDeployment.java	2007-10-31 20:34:29 UTC (rev 66630)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.aop.deployers;
+
+/**
+ * Here so that the AspectAppParsingDeployer can have an "output"
+ * 
+ * @deprecated Use the one from the aop project instead
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Deprecated
+public class AspectDeployment
+{
+
+}

Modified: projects/aop/trunk/build/build-release.xml
===================================================================
--- projects/aop/trunk/build/build-release.xml	2007-10-31 20:32:15 UTC (rev 66629)
+++ projects/aop/trunk/build/build-release.xml	2007-10-31 20:34:29 UTC (rev 66630)
@@ -99,7 +99,6 @@
       <property name="aop.50.location" value="${project.root}/aop/output/lib/jboss-aop-jdk50.jar"/>
       <property name="aop.aspect-library14.location" value="${project.root}/aspects/output/lib/jboss-standalone-aspect-library-jdk14.jar"/>
       <property name="aop.aspect-library50.location" value="${project.root}/aspects/output/lib/jboss-standalone-aspect-library-jdk50.jar"/>
-      <property name="aop.aspect-library-beans.location" value="${project.root}/asintegration/src/resources/META-INF/jboss-aspect-library-beans.xml"/>
       <property name="aop.as4-deployer.location" value="${project.root}/asintegration/output/lib/jboss-aop-as4-deployer.jar"/>
       <property name="aop.as4-deployer-jdk14.location" value="${project.root}/asintegration/output/lib/jboss-aop-as4-deployer-jdk14.jar"/>
       <property name="aop.jboss4.jdk50.location" value="${project.root}/asintegration/output/lib/jboss-aop-jboss4-jdk50.jar"/>
@@ -249,7 +248,6 @@
       <copy todir="${project.release}/jboss-50-install/lib" file="${javassist.location}"/>
       <copy todir="${project.release}/jboss-50-install/lib" file="${trove.location}"/>
       <copy todir="${project.release}/jboss-50-install/jboss-aop-jboss5.deployer" file="${aop.aspect-library50.location}"/>
-      <copy todir="${project.release}/jboss-50-install/jboss-aop-jboss5.deployer/META-INF/" file="${aop.aspect-library-beans.location}"/>
 
 
       <copy todir="${project.release}" file="RELEASE_NOTES.html"/>




More information about the jboss-cvs-commits mailing list