[jboss-cvs] JBossAS SVN: r103039 - in projects/aop/trunk: as5integration and 11 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Mar 26 08:23:43 EDT 2010


Author: flavia.rainone at jboss.com
Date: 2010-03-26 08:23:42 -0400 (Fri, 26 Mar 2010)
New Revision: 103039

Added:
   projects/aop/trunk/as5integration/
   projects/aop/trunk/as5integration/.classpath
   projects/aop/trunk/as5integration/.project
   projects/aop/trunk/as5integration/pom.xml
   projects/aop/trunk/as5integration/src/
   projects/aop/trunk/as5integration/src/assembly/
   projects/aop/trunk/as5integration/src/assembly/deployers.xml
   projects/aop/trunk/as5integration/src/assembly/mc.xml
   projects/aop/trunk/as5integration/src/main/
   projects/aop/trunk/as5integration/src/main/java/
   projects/aop/trunk/as5integration/src/main/java/org/
   projects/aop/trunk/as5integration/src/main/java/org/jboss/
   projects/aop/trunk/as5integration/src/main/java/org/jboss/aop/
   projects/aop/trunk/as5integration/src/main/java/org/jboss/aop/asintegration/
   projects/aop/trunk/as5integration/src/main/java/org/jboss/aop/asintegration/jboss5/
   projects/aop/trunk/as5integration/src/main/java/org/jboss/aop/asintegration/jboss5/AOPAnnotationMetaDataParserDeployer.java
   projects/aop/trunk/as5integration/src/main/java/org/jboss/aop/asintegration/jboss5/AspectDeployer.java
   projects/aop/trunk/asintegration-core/src/etc/jboss-install-aop.xml
Removed:
   projects/aop/trunk/asintegration-core/src/etc/jboss-60-install-aop.xml
Modified:
   projects/aop/trunk/asintegration-core/src/etc/jboss-50-install-jboss-aop-jdk50-build.xml
   projects/aop/trunk/asintegration-core/src/etc/jboss.properties
   projects/aop/trunk/build/build.xml
   projects/aop/trunk/pom.xml
Log:
[JBAOP-777] Script for installing JBoss AOP on AS5 now:
- uses vfs2 compatible classes (see as5integration)
- uses jboss-classpool Alpha3 jars (that depend on VFS2)
- adds jboss-classpool and related jars to bootstrap classpath of server
- overwrites conf/bootstrap/aop.xml file

Added: projects/aop/trunk/as5integration/.classpath
===================================================================
--- projects/aop/trunk/as5integration/.classpath	                        (rev 0)
+++ projects/aop/trunk/as5integration/.classpath	2010-03-26 12:23:42 UTC (rev 103039)
@@ -0,0 +1,6 @@
+<classpath>
+  <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+  <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+</classpath>
\ No newline at end of file

Added: projects/aop/trunk/as5integration/.project
===================================================================
--- projects/aop/trunk/as5integration/.project	                        (rev 0)
+++ projects/aop/trunk/as5integration/.project	2010-03-26 12:23:42 UTC (rev 103039)
@@ -0,0 +1,17 @@
+<projectDescription>
+  <name>jboss-aop-as5integration</name>
+  <comment>JBoss AOP AS 5 Integration</comment>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+    <buildCommand>
+      <name>org.maven.ide.eclipse.maven2Builder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+    <nature>org.maven.ide.eclipse.maven2Nature</nature>
+  </natures>
+</projectDescription>
\ No newline at end of file

Added: projects/aop/trunk/as5integration/pom.xml
===================================================================
--- projects/aop/trunk/as5integration/pom.xml	                        (rev 0)
+++ projects/aop/trunk/as5integration/pom.xml	2010-03-26 12:23:42 UTC (rev 103039)
@@ -0,0 +1,182 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <groupId>org.jboss.aop</groupId>
+    <artifactId>jboss-aop-parent</artifactId>
+    <version>2.1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>jboss-aop-as5integration</artifactId>
+  <packaging>jar</packaging>
+  <name>JBoss AOP AS 5 Integration</name>
+  <description>JBoss AOP AS 5 Integration</description>
+  
+  <build>
+    <finalName>${project.artifactId}</finalName>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.5</version>
+        <configuration>
+          <skip>true</skip>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <version>2.2-beta-2</version>
+        <executions>
+          <execution>
+            <id>mc</id>
+            <phase>package</phase>
+            <goals>
+              <goal>attached</goal>
+            </goals>
+            <configuration>
+              <outputDirectory>${project.build.directory}/as5-install</outputDirectory>
+              <descriptors>
+                <descriptor>src/assembly/mc.xml</descriptor>
+              </descriptors>
+              <finalName>jboss-aop-asintegration</finalName>
+              <archive>
+                <manifest>
+                  <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+                  <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+                </manifest>
+                <manifestEntries>
+                  <Implementation-URL>${pom.url}</Implementation-URL>
+                </manifestEntries>
+              </archive>
+            </configuration>
+          </execution>
+          <execution>
+            <id>deployers</id>
+            <phase>package</phase>
+            <goals>
+              <goal>attached</goal>
+            </goals>
+            <configuration>
+              <outputDirectory>${project.build.directory}/as5-install</outputDirectory>
+              <descriptors>
+                <descriptor>src/assembly/deployers.xml</descriptor>
+              </descriptors>
+              <finalName>jboss-aop</finalName>
+              <archive>
+                <manifest>
+                  <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+                  <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+                </manifest>
+                <manifestEntries>
+                  <Implementation-URL>${pom.url}</Implementation-URL>
+                </manifestEntries>
+              </archive>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>copy</id>
+            <phase>package</phase>
+            <goals>
+              <goal>copy</goal>
+            </goals>
+            <configuration>
+              <artifactItems>
+                <artifactItem>
+                  <groupId>org.jboss.classpool</groupId>
+                  <artifactId>jboss-classpool-scoped</artifactId>
+                  <version>1.0.0.Alpha3</version>
+                  <type>jar</type>
+                  <outputDirectory>${project.build.directory}/as5-install</outputDirectory>
+                  <destFileName>jboss-classpool-scoped.jar</destFileName>
+                </artifactItem>
+                <artifactItem>
+                  <groupId>org.jboss.classpool</groupId>
+                  <artifactId>jboss-classpool</artifactId>
+                  <version>1.0.0.Alpha3</version>
+                  <type>jar</type>
+                  <outputDirectory>${project.build.directory}/as5-install</outputDirectory>
+                  <destFileName>jboss-classpool.jar</destFileName>
+                </artifactItem>
+                <artifactItem>
+                  <groupId>org.jboss.classpool</groupId>
+                  <artifactId>jboss-classpool-jbosscl</artifactId>
+                  <version>1.0.0.Alpha3</version>
+                  <type>jar</type>
+                 <outputDirectory>${project.build.directory}/as5-install</outputDirectory>
+                  <destFileName>jboss-classpool-jbosscl.jar</destFileName>
+                </artifactItem>
+              </artifactItems>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+
+    </plugins>
+    
+  </build>
+  
+  <dependencies>
+    <dependency>
+      <groupId>org.jboss.aop</groupId>
+      <artifactId>jboss-aop-asintegration-mc</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>org.jboss</groupId>
+          <artifactId>jboss-vfs</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.jboss.deployers</groupId>
+          <artifactId>jboss-deployers-vfs</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.aop</groupId>
+      <artifactId>jboss-aop-deployers</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>org.jboss</groupId>
+          <artifactId>jboss-vfs</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.jboss.deployers</groupId>
+          <artifactId>jboss-deployers-vfs</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss</groupId>
+      <artifactId>jboss-vfs</artifactId>
+      <version>2.1.3.SP1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.deployers</groupId>
+      <artifactId>jboss-deployers-vfs</artifactId>
+      <version>2.0.8.GA</version>
+    </dependency>
+  </dependencies>
+  
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+      <groupId>org.jboss</groupId>
+      <artifactId>jboss-vfs</artifactId>
+      <version>2.1.3.SP1</version>
+    </dependency>
+    </dependencies>
+  </dependencyManagement>
+  
+</project>

Added: projects/aop/trunk/as5integration/src/assembly/deployers.xml
===================================================================
--- projects/aop/trunk/as5integration/src/assembly/deployers.xml	                        (rev 0)
+++ projects/aop/trunk/as5integration/src/assembly/deployers.xml	2010-03-26 12:23:42 UTC (rev 103039)
@@ -0,0 +1,32 @@
+<assembly>
+  <id>deployers</id>
+  <formats>
+    <format>jar</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+  <dependencySets>
+    <dependencySet>
+      <includes>
+        <include>org.jboss.aop:jboss-aop-deployers</include>
+       </includes>
+       <unpack>true</unpack>
+       <unpackOptions>
+         <excludes>
+           <exclude>**/AOPAnnotationMetaDataParserDeployer*.class</exclude>
+         </excludes>
+       </unpackOptions>
+    </dependencySet>
+    <dependencySet>
+      <includes>
+        <include>org.jboss.aop:jboss-aop-as5integration</include>
+      </includes>
+      <unpack>true</unpack>
+       <unpackOptions>
+         <excludes>
+           <exclude>**/AspectDeployer*.class</exclude>
+         </excludes>
+       </unpackOptions>
+    </dependencySet>
+  </dependencySets>
+
+</assembly>
\ No newline at end of file


Property changes on: projects/aop/trunk/as5integration/src/assembly/deployers.xml
___________________________________________________________________
Name: svn:executable
   + *

Added: projects/aop/trunk/as5integration/src/assembly/mc.xml
===================================================================
--- projects/aop/trunk/as5integration/src/assembly/mc.xml	                        (rev 0)
+++ projects/aop/trunk/as5integration/src/assembly/mc.xml	2010-03-26 12:23:42 UTC (rev 103039)
@@ -0,0 +1,32 @@
+<assembly>
+  <id>mc</id>
+  <formats>
+    <format>jar</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+  <dependencySets>
+    <dependencySet>
+      <includes>
+        <include>org.jboss.aop:jboss-aop-asintegration-mc</include>
+       </includes>
+       <unpack>true</unpack>
+       <unpackOptions>
+         <excludes>
+           <exclude>**/AspectDeployer*.class</exclude>
+         </excludes>
+       </unpackOptions>
+    </dependencySet>
+    <dependencySet>
+      <includes>
+        <include>org.jboss.aop:jboss-aop-as5integration</include>
+      </includes>
+      <unpack>true</unpack>
+      <unpackOptions>
+         <excludes>
+           <exclude>**/AOPAnnotationMetaDataParserDeployer*.class</exclude>
+         </excludes>
+       </unpackOptions>
+    </dependencySet>
+  </dependencySets>
+
+</assembly>
\ No newline at end of file


Property changes on: projects/aop/trunk/as5integration/src/assembly/mc.xml
___________________________________________________________________
Name: svn:executable
   + *

Added: projects/aop/trunk/as5integration/src/main/java/org/jboss/aop/asintegration/jboss5/AOPAnnotationMetaDataParserDeployer.java
===================================================================
--- projects/aop/trunk/as5integration/src/main/java/org/jboss/aop/asintegration/jboss5/AOPAnnotationMetaDataParserDeployer.java	                        (rev 0)
+++ projects/aop/trunk/as5integration/src/main/java/org/jboss/aop/asintegration/jboss5/AOPAnnotationMetaDataParserDeployer.java	2010-03-26 12:23:42 UTC (rev 103039)
@@ -0,0 +1,196 @@
+/*
+* 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.asintegration.jboss5;
+
+import java.io.BufferedInputStream;
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import javassist.bytecode.ClassFile;
+
+import org.jboss.aop.AspectAnnotationLoader;
+import org.jboss.aop.microcontainer.beans.metadata.AOPDeployment;
+import org.jboss.aop.microcontainer.beans.metadata.AspectManagerAwareBeanMetaDataFactory;
+import org.jboss.aop.microcontainer.beans.metadata.MicrocontainerAnnotationLoaderStrategy;
+import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VirtualFileFilter;
+import org.jboss.virtual.VisitorAttributes;
+import org.jboss.virtual.plugins.context.jar.JarUtils;
+import org.jboss.virtual.plugins.vfs.helpers.FilterVirtualFileVisitor;
+import org.jboss.virtual.plugins.vfs.helpers.SuffixesExcludeFilter;
+
+/**
+ * Reads the annotations and converts them into AOP metadata to be deployed properly 
+ * by the AOPDeploymentAopMetaDataDeployer
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision$
+ */
+public class AOPAnnotationMetaDataParserDeployer extends AbstractDeployer
+{
+   public AOPAnnotationMetaDataParserDeployer(int xmlParserOrder)
+   {
+      super.setOutput(AOPDeployment.class);
+      super.setStage(DeploymentStages.POST_PARSE);
+      if (xmlParserOrder != 0)
+      {
+         //Make this come after the AOPXMLMetaDataParserDeployer if the relative order is set
+         super.setRelativeOrder(xmlParserOrder + 1);
+      }
+   }
+   
+   public AOPAnnotationMetaDataParserDeployer()
+   {
+      this(0);
+   }
+
+   public void deploy(DeploymentUnit unit) throws DeploymentException
+   {
+      // Ignore non-vfs deployments
+      if (unit instanceof VFSDeploymentUnit == false)
+      {
+         log.trace("Not a vfs deployment: " + unit.getName());
+         return;
+      }
+      // See if the suffix matches the .aop requirement
+      if (unit.getSimpleName().endsWith(".aop") == false)
+      {
+         log.trace("Unit name does not end in .aop: " + unit.getSimpleName());
+         return;
+      }
+      internalDeploy((VFSDeploymentUnit)unit);
+   }
+   
+   private void internalDeploy(VFSDeploymentUnit unit) throws DeploymentException
+   {
+      MicrocontainerAnnotationLoaderStrategy strategy = new MicrocontainerAnnotationLoaderStrategy(); 
+      AspectAnnotationLoader loader = new AspectAnnotationLoader(null, strategy);
+      
+      List<VirtualFile> files = getClasses(unit);
+      for(VirtualFile file : files)
+      {
+         try
+         {
+            ClassFile cf = loadClassFile(file);
+            log.debug("Deploying possibly annotated class " + cf.getName());
+            loader.deployClassFile(cf);
+         }
+         catch (Exception e)
+         {
+            throw new DeploymentException("Error reading annotations for " + file, e);
+         }
+      }
+      
+      List<AspectManagerAwareBeanMetaDataFactory> factories = strategy.getFactories();
+      
+      AOPDeployment deployment = unit.getAttachment(AOPDeployment.class);
+      if (factories != null && factories.size() > 0)
+      {
+         if (deployment == null)
+         {
+            deployment = new AOPDeployment();
+            unit.addAttachment(AOPDeployment.class.getName(), deployment, AOPDeployment.class);
+         }
+         if (deployment.getBeanFactories() == null)
+         {
+            deployment.setBeanFactories(new ArrayList<BeanMetaDataFactory>());
+         }
+         deployment.getBeanFactories().addAll(factories);
+      }  
+   }
+
+   private ClassFile loadClassFile(VirtualFile file)
+   {
+      DataInputStream din = null;
+      ClassFile cf = null;
+      try
+      {
+         InputStream in = file.openStream();
+         din = new DataInputStream(new BufferedInputStream(in));
+         cf = new ClassFile(din);
+      }
+      catch (IOException e)
+      {
+         throw new RuntimeException("Error reading " + file, e);
+      }
+      finally
+      {
+         try
+         {
+            din.close();
+         }
+         catch (IOException ignored)
+         {
+         }
+      }
+      
+      return cf;
+   }
+
+   private List<VirtualFile> getClasses(VFSDeploymentUnit unit)
+   {
+      VisitorAttributes va = new VisitorAttributes();
+      va.setLeavesOnly(true);
+      ClassFileFilter filter = new ClassFileFilter();
+      SuffixesExcludeFilter noJars = new SuffixesExcludeFilter(JarUtils.getSuffixes());
+      va.setRecurseFilter(noJars);
+      FilterVirtualFileVisitor visitor = new FilterVirtualFileVisitor(filter, va);
+
+      for (VirtualFile vf : unit.getClassPath())
+      {
+         try
+         {
+            vf.visit(visitor);
+         }
+         catch (IOException e)
+         {
+            throw new RuntimeException(e);
+         }
+      }
+      return visitor.getMatched();
+
+   }
+   
+   private static class ClassFileFilter implements VirtualFileFilter
+   {
+      public boolean accepts(VirtualFile file)
+      {
+         try
+         {
+            return file.isLeaf() && file.getName().endsWith(".class");
+         }
+         catch (IOException e)
+         {
+            throw new RuntimeException("Error visiting file: " + file.getName(), e);
+         }
+      }
+   }
+}


Property changes on: projects/aop/trunk/as5integration/src/main/java/org/jboss/aop/asintegration/jboss5/AOPAnnotationMetaDataParserDeployer.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: projects/aop/trunk/as5integration/src/main/java/org/jboss/aop/asintegration/jboss5/AspectDeployer.java
===================================================================
--- projects/aop/trunk/as5integration/src/main/java/org/jboss/aop/asintegration/jboss5/AspectDeployer.java	                        (rev 0)
+++ projects/aop/trunk/as5integration/src/main/java/org/jboss/aop/asintegration/jboss5/AspectDeployer.java	2010-03-26 12:23:42 UTC (rev 103039)
@@ -0,0 +1,378 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, Red Hat Middleware LLC., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.asintegration.jboss5;
+
+import java.io.BufferedInputStream;
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import javassist.bytecode.ClassFile;
+
+import org.jboss.aop.AspectAnnotationLoader;
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.AspectXmlLoader;
+import org.jboss.aop.Domain;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VirtualFileFilter;
+import org.jboss.virtual.VisitorAttributes;
+import org.jboss.virtual.plugins.context.jar.JarUtils;
+import org.jboss.virtual.plugins.vfs.helpers.FilterVirtualFileVisitor;
+import org.jboss.virtual.plugins.vfs.helpers.SuffixesExcludeFilter;
+import org.w3c.dom.Document;
+
+/**
+ * Deployer for Aspects
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ * @author <a href="mailto:kabir.khan at jboss.org">Kabir Khan</a>
+ * @author adrian at jboss.org
+ */
+public class AspectDeployer extends AbstractVFSRealDeployer
+{
+   private static final String AOP_JAR_SUFFIX = ".aop";
+   private static final String AOP_DD_SUFFIX = "-aop.xml";
+
+   /** The aspect manager */
+   private AspectManager aspectManager;
+   
+   /**
+    * Create a new AspectDeployer.
+    */
+   public AspectDeployer()
+   {
+      setStage(DeploymentStages.POST_CLASSLOADER);
+   }
+
+   /**
+    * Get the aspectManager.
+    * 
+    * @return the aspectManager.
+    */
+   public AspectManager getAspectManager()
+   {
+      return aspectManager;
+   }
+
+   /**
+    * Set the aspectManager.
+    * 
+    * @param aspectManager the aspectManager.
+    */
+   public void setAspectManager(AspectManager aspectManager)
+   {
+      this.aspectManager = aspectManager;
+   }
+
+   /**
+    * Validate the configuration
+    */
+   public void create()
+   {
+      if (aspectManager == null)
+         throw new IllegalStateException("No aspect manager configured");
+   }
+   
+   public void deploy(VFSDeploymentUnit unit) throws DeploymentException
+   {
+      AspectManager manager = getCorrectManager(unit);
+      unit.addAttachment(AspectManager.class, manager);
+      
+      List<VirtualFile> files = unit.getMetaDataFiles(null, AOP_DD_SUFFIX);
+
+      if (isAopArchiveOrFolder(unit))
+      {
+         deployAnnotations(manager, unit);
+      }
+      
+      if (files.size() > 0)
+      {
+         deployXml(manager, unit, files);
+      }
+   }
+   
+   public void undeploy(VFSDeploymentUnit unit)
+   {
+      try
+      {
+         AspectManager manager = unit.getAttachment(AspectManager.class);
+
+         List<VirtualFile> files = unit.getMetaDataFiles(null, AOP_DD_SUFFIX);
+   
+         if (isAopArchiveOrFolder(unit))
+         {
+            undeployAnnotations(manager, unit);
+         }
+         
+         if (files.size() > 0)
+         {
+            undeployXml(manager, unit, files);
+         }
+      }
+      finally
+      {
+         AOPClassLoaderInitializer.unregisterLoaders(aspectManager, unit);
+      }
+   }
+
+   private void deployXml(AspectManager manager, VFSDeploymentUnit unit, List<VirtualFile> files) throws DeploymentException
+   {
+      log.info("Deploying xml into " + manager + " for " + unit.getClassLoader());   
+      
+      ArrayList<VirtualFile> deployedFiles = new ArrayList<VirtualFile>(files.size());
+      for (VirtualFile vf : files)
+      {
+         deployedFiles.add(vf);
+         try
+         {
+            log.debug("deploying: " + vf.toURL() + " into " + manager);
+            InputStream is = vf.openStream();
+            try
+            {
+               Document doc = AspectXmlLoader.loadDocument(is);
+               AspectXmlLoader loader = new AspectXmlLoader();
+      
+               loader.setManager(manager);
+               loader.setClassLoader(unit.getClassLoader());
+               loader.deployXML(doc, vf.toURL(), unit.getClassLoader());
+            }
+            finally
+            {
+               is.close();
+            }
+         }
+         catch (Exception e)
+         {
+            //Unwind things already installed, in the reverse order
+            for (int i = deployedFiles.size() - 1 ; i >= 0 ; i--)
+            {
+               undeployXml(manager, deployedFiles.get(i));
+            }
+            
+            throw DeploymentException.rethrowAsDeploymentException("Error deploying xml " + vf.getName() + " into " + manager, e);
+         }
+      }
+   }
+
+   private void undeployXml(AspectManager manager, VFSDeploymentUnit unit, List<VirtualFile> files)
+   {
+      for (VirtualFile vf : files)
+      {
+         undeployXml(manager, vf);
+      }
+   }
+   
+   private void undeployXml(AspectManager manager, VirtualFile vf)
+   {
+      try
+      {
+         log.debug("undeploying: " + vf.toURL() + " from " + manager);
+         InputStream is = vf.openStream();
+         try
+         {
+            Document doc = AspectXmlLoader.loadDocument(is);
+            AspectXmlLoader loader = new AspectXmlLoader();
+            
+            loader.setManager(manager);
+            loader.undeployXML(doc, vf.toURL());
+         }
+         finally
+         {
+            try
+            {
+               is.close();
+            }
+            catch(IOException ignore)
+            {
+            }
+         }
+      }
+      catch (Exception e)
+      {
+         log.warn("Error undeploying xml " + vf.getName() + " from " + manager, e);
+      }
+   }
+
+   private void deployAnnotations(AspectManager manager, VFSDeploymentUnit unit) throws DeploymentException
+   {
+      log.info("Deploying AOP annotations into " + manager + " for " + unit.getClassLoader());   
+
+      AspectAnnotationLoader loader = getAnnotationLoader(manager, unit); 
+      List<VirtualFile> files = getClasses(unit);
+      ArrayList<VirtualFile> deployedFiles = new ArrayList<VirtualFile>(files.size());
+      for(VirtualFile file : files)
+      {
+         try
+         {
+            ClassFile cf = loadClassFile(file);
+            log.debug("Deploying possibly annotated class " + cf.getName() + " into " + manager);
+            loader.deployClassFile(cf);
+         }
+         catch (Exception e)
+         {
+            //Unwind things already installed, in the reverse order
+            for (int i = deployedFiles.size() ; i >= 0 ; i-- )
+            {
+               undeployAnnotation(loader, deployedFiles.get(i));
+            }
+            throw new DeploymentException("Error reading annotations for " + file + " during deployment into " + manager, e);
+         }
+      }
+   }
+   
+   private void undeployAnnotations(AspectManager manager, VFSDeploymentUnit unit)
+   {
+      AspectAnnotationLoader loader = getAnnotationLoader(manager, unit); 
+      List<VirtualFile> files = getClasses(unit);
+      for(VirtualFile file : files)
+      {
+         undeployAnnotation(loader, file);
+      }
+   }
+
+   private void undeployAnnotation(AspectAnnotationLoader loader, VirtualFile file)
+   {
+      try
+      {
+         ClassFile cf = loadClassFile(file);
+         log.debug("Undeploying possibly annotated class " + cf.getName());
+         loader.undeployClassFile(cf);
+      }
+      catch (Exception e)
+      {
+         log.warn("Error reading annotations for " + file, e);
+      }
+   }
+   
+   private AspectAnnotationLoader getAnnotationLoader(AspectManager manager, VFSDeploymentUnit unit)
+   {
+      AspectAnnotationLoader loader = new AspectAnnotationLoader(manager);
+      loader.setClassLoader(unit.getClassLoader());
+      return loader;
+   }
+   
+   private ClassFile loadClassFile(VirtualFile file)
+   {
+      DataInputStream din = null;
+      ClassFile cf = null;
+      try
+      {
+         InputStream in = file.openStream();
+         din = new DataInputStream(new BufferedInputStream(in));
+         cf = new ClassFile(din);
+      }
+      catch (IOException e)
+      {
+         throw new RuntimeException("Error reading " + file, e);
+      }
+      finally
+      {
+         try
+         {
+            din.close();
+         }
+         catch (IOException ignored)
+         {
+         }
+      }
+      
+      return cf;
+   }
+   
+   private List<VirtualFile> getClasses(VFSDeploymentUnit unit)
+   {
+      VisitorAttributes va = new VisitorAttributes();
+      va.setLeavesOnly(true);
+      ClassFileFilter filter = new ClassFileFilter();
+      SuffixesExcludeFilter noJars = new SuffixesExcludeFilter(JarUtils.getSuffixes());
+      va.setRecurseFilter(noJars);
+      FilterVirtualFileVisitor visitor = new FilterVirtualFileVisitor(filter, va);
+
+      for (VirtualFile vf : unit.getClassPath())
+      {
+         try
+         {
+            vf.visit(visitor);
+         }
+         catch (IOException e)
+         {
+            throw new RuntimeException(e);
+         }
+      }
+      return visitor.getMatched();
+
+   }
+   
+   private boolean isAopArchiveOrFolder(VFSDeploymentUnit unit)
+   {
+      String name = unit.getName();
+      
+      //If name is of format 'blah-blah.aop!/' get rid of the trailing '!' and '/', and see if it ends with .aop
+      int index = name.length();
+      if (name.charAt(name.length() - 1) == '/') 
+      {
+         index--;
+      }
+      if (name.charAt(name.length() - 2) == '!')
+      {
+         index--;
+      }
+      String realName = (index == name.length()) ? name : name.substring(0, index);
+      
+      return (realName.endsWith(AOP_JAR_SUFFIX));
+   }
+   
+   private AspectManager getCorrectManager(final VFSDeploymentUnit unit)
+   {
+      //Scoped AOP deployments are only available when deployed as part of a scoped sar, ear etc.
+      //It can contain an aop.xml file, or it can be part of a .aop file
+      Domain domain = AOPClassLoaderInitializer.initializeForUnit(unit); 
+      if (domain != null)
+      {
+         return domain;
+      }
+      
+      return aspectManager;
+   }
+   
+   private static class ClassFileFilter implements VirtualFileFilter
+   {
+      public boolean accepts(VirtualFile file)
+      {
+         try
+         {
+            return file.isLeaf() && file.getName().endsWith(".class");
+         }
+         catch (IOException e)
+         {
+            throw new RuntimeException("Error visiting file: " + file.getName(), e);
+         }
+      }
+   }
+
+}


Property changes on: projects/aop/trunk/as5integration/src/main/java/org/jboss/aop/asintegration/jboss5/AspectDeployer.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Modified: projects/aop/trunk/asintegration-core/src/etc/jboss-50-install-jboss-aop-jdk50-build.xml
===================================================================
--- projects/aop/trunk/asintegration-core/src/etc/jboss-50-install-jboss-aop-jdk50-build.xml	2010-03-26 12:13:24 UTC (rev 103038)
+++ projects/aop/trunk/asintegration-core/src/etc/jboss-50-install-jboss-aop-jdk50-build.xml	2010-03-26 12:23:42 UTC (rev 103039)
@@ -13,6 +13,7 @@
       <property name="jboss.bin.dir" value="${jboss.home}/bin"/>
       <property name="jboss.client.dir" value="${jboss.home}/client"/>
       <property name="jboss.backup.dir" value="${jboss.config.dir}/deployers.bak"/>
+      <property name="jboss.bootstrap.dir" value="${jboss.config.dir}/conf/bootstrap"/>
 
       <available file="${jboss.home}" property="jboss.exists" type="dir"/>
       <fail unless="jboss.exists" message="${jboss.home} does not exist. Modify 'jboss.home' in jboss.properties to be a valid root of a jboss installation"/>
@@ -26,6 +27,9 @@
       <available file="${jboss.config.dir}" property="config.exists" type="dir"/>
       <fail unless="config.exists" message="${jboss.config.dir} does not exist. Modify 'jboss.config' in jboss.properties to be a valid server configuration"/>
 
+      <available file="${jboss.bootstrap.dir}" property="bootstrap.exists" type="dir"/>
+      <fail unless="bootstrap.exists" message="${jboss.bootstrap.dir} does not exist. Modify 'jboss.config' in jboss.properties to be a valid server configuration"/>
+
       <property name="deployers.dir" value="${jboss.config.dir}/deployers"/>
 
       <property name="aspect.deployer" value="${deployers.dir}/jboss-aop-jboss5.deployer"/>
@@ -51,18 +55,61 @@
       <property name="bak.jbossaop-client" value="${jboss.client.dir}/jboss-aop-client.bak"/>
       <available file="${bak.jbossaop-client}" property="jbossaop-client.bak.exists"/>
       <condition property="backup.jbossaop-client" value="true">
-         <not>
-            <isset property="jbossaop-client.bak.exists"/>
-         </not>
+         <and>
+            <not>
+               <isset property="jbossaop-client.bak.exists"/>
+            </not>
+            <istrue value="${backup}"/>
+         </and>
       </condition>
 
+      <property name="jboss.run.conf" value="${jboss.bin.dir}/run.conf"/>
+      <available file="${jboss.run.conf}" property="jboss.run.conf.exists"/>
+      <fail unless="jboss.run.conf.exists" message="${jboss.run.conf} does not exist. Modify 'jboss.home' in jboss.properties to be a valid root of a jboss installation"/>
+
+      <condition property="backup.enabled" value="true">
+         <istrue value="${backup}"/>
+      </condition>
+
+      <property name="bak.jboss.run.conf" value="${jboss.run.conf}.bak"/>
+      <available file="${bak.jboss.run.conf}" property="jboss.run.conf.bak.exists"/>
+      <condition property="backup.jboss.run.conf" value="true">
+         <and>
+            <not>
+               <isset property="jboss.run.conf.bak.exists"/>
+            </not>
+            <istrue value="${backup}"/>
+         </and>
+      </condition>
+
+      <property name="jboss.run.conf.bat" value="${jboss.bin.dir}/run.conf.bat"/>
+      <available file="${jboss.run.conf.bat}" property="jboss.run.conf.bat.exists"/>
+      <fail unless="jboss.run.conf.bat.exists" message="${jboss.run.conf.bat} does not exist. Modify 'jboss.home' in jboss.properties to be a valid root of a jboss installation"/>
+
+      <property name="bak.jboss.run.conf.bat" value="${jboss.run.conf.bat}.bak"/>
+      <available file="${bak.jboss.run.conf.bat}" property="jboss.run.conf.bat.bak.exists"/>
+      <condition property="backup.jboss.run.conf.bat" value="true">
+         <and>
+            <not>
+               <isset property="jboss.run.conf.bat.bak.exists"/>
+            </not>
+            <istrue value="${backup}"/>
+         </and>
+      </condition>
+
+      <loadfile srcFile="${jboss.run.conf}" property="jboss.run.conf.contents"/>
+      <condition property="run.conf.updated" value="true">
+         <matches string="${jboss.run.conf.contents}" pattern=".*# Appended by JBoss AOP Installation Script.*# End of lines added by JBoss AOP Installation Script.*"
+            multiline="true" singleline="true"/>
+      </condition>
+
       <tstamp>
          <format property="tstamp"  pattern="yyyyMMdd-HHmmss"/>
       </tstamp>
    </target>
 
 
-   <target name="backup.lib" depends="init">
+   <target name="backup.lib" depends="init" if="backup.enabled">
       <property name="old.lib" value="${jboss.lib}-${tstamp}.bak"/>
       <echo>Backing up existing lib directory to ${old.lib}</echo>
       <copy todir="${old.lib}">
@@ -70,7 +117,7 @@
       </copy>
    </target>
 
-   <target name="backup.deployer" depends="init">
+   <target name="backup.deployer" depends="init" if="backup.enabled">
       <mkdir dir="${jboss.backup.dir}"/>
       <echo>Backing up existing aop deployer to ${old.deployer}</echo>
       <copy todir="${jboss.backup.dir}/jboss-aop-jboss5.deployer-${tstamp}.bak">
@@ -83,6 +130,16 @@
       <copy file="${lib.jbossaop-client.injboss}" tofile="${bak.jbossaop-client}"/>
    </target>
 
+   <target name="backup.run.conf" if="backup.jboss.run.conf">
+      <echo>Backing up existing ${jboss.run.conf} to ${bak.jboss.run.conf}</echo>
+      <copy file="${jboss.run.conf}" tofile="${bak.jboss.run.conf}"/>
+   </target>
+
+   <target name="backup.run.conf.bat" if="backup.jboss.run.conf.bat">
+      <echo>Backing up existing ${jboss.run.conf.bat} to ${bak.jboss.run.conf.bat}</echo>
+      <copy file="${jboss.run.conf.bat}" tofile="${bak.jboss.run.conf.bat}"/>
+   </target>
+
    <target name="install.lib" depends="backup.lib,backup.client.lib">
       <copy todir="${jboss.lib}" overwrite="true">
          <fileset dir="lib">
@@ -108,6 +165,20 @@
       </copy>
    </target>
 
+   <target name="install.run.conf" depends="backup.run.conf,backup.run.conf.bat" unless="run.conf.updated">
+      <echo>Appending the contents of append-run.conf to ${jboss.run.conf}</echo>
+      <concat destfile="${jboss.run.conf}" append="true">
+         <fileset file="append-run.conf"/>
+      </concat>
+      <echo>Appending the contents of append-run.conf.bat to ${jboss.run.conf.bat}</echo>
+      <concat destfile="${jboss.run.conf.bat}" append="true">
+         <fileset file="append-run.conf.bat"/>
+      </concat>
+   </target>
 
-   <target name="install" depends="install.lib,install.deployer,install.bin"/>
+   <target name="install.aop.xml" depends="init">
+      <copy file="aop.xml" todir="${jboss.bootstrap.dir}" overwrite="true"/>
+   </target>
+
+   <target name="install" depends="install.lib,install.deployer,install.bin,install.aop.xml,install.run.conf"/>
 </project>

Deleted: projects/aop/trunk/asintegration-core/src/etc/jboss-60-install-aop.xml
===================================================================
--- projects/aop/trunk/asintegration-core/src/etc/jboss-60-install-aop.xml	2010-03-26 12:13:24 UTC (rev 103038)
+++ projects/aop/trunk/asintegration-core/src/etc/jboss-60-install-aop.xml	2010-03-26 12:23:42 UTC (rev 103039)
@@ -1,124 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-   AOP configuration
--->
-<deployment xmlns="urn:jboss:bean-deployer:2.0">
-
-   <classloader><inject bean="aop-classloader:0.0.0"/></classloader>
-
-   <classloader name="aop-classloader" xmlns="urn:jboss:classloader:1.0" export-all="NON_EMPTY" import-all="true">
-      <root>${jboss.lib.url}jboss-aop-asintegration-core.jar</root>
-      <root>${jboss.lib.url}jboss-aop-asintegration-mc.jar</root>
-      <root>${jboss.lib.url}jboss-aop-deployers.jar</root>
-      <root>${jboss.lib.url}jboss-aop-jboss5.jar</root>
-      <root>${jboss.lib.url}jboss-classpool.jar</root>
-      <root>${jboss.lib.url}jboss-classpool-jbosscl.jar</root>
-      <root>${jboss.lib.url}jboss-deployers-impl.jar</root>
-   </classloader>
-
-   <!-- Integration -->
-   <bean name="AOPClassLoaderScopingPolicy" class="org.jboss.aop.asintegration.jboss5.VFSClassLoaderScopingPolicy"/>
-   
-   <bean name="AOPClassPoolFactory" class="org.jboss.classpool.plugins.jbosscl.JBossClDelegatingClassPoolFactory">
-      <constructor>
-         <parameter><inject bean="AOPClassLoaderScopingPolicy" property="registry"/></parameter>
-         <parameter><inject bean="AOPRegisterModuleCallback"/></parameter>
-      </constructor>
-   </bean>
-
-   <bean name="AOPJBossIntegration" class="org.jboss.aop.asintegration.jboss5.JBoss5Integration">
-      <property name="classPoolFactory"><inject bean="AOPClassPoolFactory"/></property>
-      <property name="aopClassLoaderScopingPolicy"><inject bean="AOPClassLoaderScopingPolicy"/></property>
-   </bean>
-
-   <bean name="DefaultAspectManager" class="org.jboss.aop.microcontainer.beans.metadata.DefaultAspectManager">
-      <property name="managerBean">AspectManager</property>
-      <property name="managerProperty">aspectManager</property>
-   </bean>
-
-   <!-- bean name="AOPBootstrap" class="org.jboss.aop.asintegration.jboss5.AOPBootstrap" -->
-      <!--  This one lives in AS 5 source tree -->
-      <!-- property name="policy"><inject bean="AOPClassLoaderScopingPolicy"/></property>
-       <property name="manager"><inject bean="AspectManager" property="aspectManager"/></property>
-   </bean-->
-
-<bean name="ClassLoaderDomainRegistry" class="org.jboss.aop.asintegration.jboss5.AOPVFSClassLoaderDomainRegistry">
-     <constructor factoryMethod="getRegistry">
-	<factory bean="AOPClassLoaderScopingPolicy"/>
-     </constructor>
-        </bean>
-
-
-   <bean name="AOPRegisterModuleCallback" class="org.jboss.classpool.plugins.jbosscl.RegisterModuleCallback">
-      <!-- classloader><null/></classloader -->
-     <constructor>
-            <parameter><inject bean="ClassLoaderDomainRegistry"/></parameter>
-                 </constructor>
-                      <install method="addModuleRegistry" bean="ClassLoading" whenRequired="Start">
-                             <parameter><this/></parameter>
-                                  </install>
-                                  <install method="addModule">
-                                    <parameter><inject bean="bootstrap-classloader:0.0.0$MODULE"/></parameter>
-                                  </install>
-<!--                                  <install method="addModule" -->
-                                       <uninstall method="removeModuleRegistry" bean="ClassLoading" whenRequired="Start">
-                                              <parameter><this/></parameter>
-                                                   </uninstall>
-                                                     </bean>
-
-
-
-<!--
-      Valid values for the AspectManager bean for use with enableTransformer=true are:
-      * org.jboss.aop.deployers.AspectManagerJDK5 - works with the -javaagent:pluggable-instrumentor.jar switch
-      * org.jboss.aop.deployers.AspectManagerJRockit - works with JRockit and the -Xmanagement:class=org.jboss.aop.hook.JRockitPluggableClassPreProcessor switch
-   -->
-   <bean name="AspectManager" class="org.jboss.aop.deployers.AspectManagerJDK5">
-      <constructor>
-         <parameter><![CDATA[
-	         <aop>
-			      <aspect name="mainDeployer" class="org.jboss.profileservice.aop.MainDeployerAspect"/>
-					   <bind pointcut="execution(* $instanceof{org.jboss.deployers.spi.deployment.MainDeployer}->process(..))">
-				      <advice name="process" aspect="mainDeployer"/>
-				   </bind>
-					<aspect name="persist" class="org.jboss.profileservice.aop.PersistAspect"/>
-					<bind pointcut="execution(* $instanceof{org.jboss.managed.api.ManagedProperty}->setValue(..))">
-				      <advice name="setValue" aspect="persist"/>
-				   </bind>
-				</aop>]]>
-	      </parameter>
-      </constructor>
-
-      <property name="jbossIntegration"><inject bean="AOPJBossIntegration"/></property>
-
-      <property name="enableLoadtimeWeaving">false</property>
-      <!-- only relevant when EnableLoadtimeWeaving is true.
-           When transformer is on, every loaded class gets
-           transformed.  If AOP can't find the class, then it
-           throws an exception.  Sometimes, classes may not have
-           all the classes they reference.  So, the Suppressing
-           is needed.  (i.e. Jboss cache in the default configuration -->
-      <property name="suppressTransformationErrors">true</property>
-      <property name="prune">true</property>
-      <property name="include">org.jboss.test., org.jboss.injbossaop.</property>
-      <property name="exclude">org.jboss.</property>
-      <!-- This avoids instrumentation of hibernate cglib enhanced proxies
-      <property name="ignore">*$$EnhancerByCGLIB$$*</property> -->
-      <property name="optimized">true</property>
-      <property name="verbose">false</property>
-      <!--
-         Available choices for this attribute are:
-            org.jboss.aop.instrument.ClassicInstrumentor (default)
-            org.jboss.aop.instrument.GeneratedAdvisorInstrumentor
-       <property name="instrumentor">org.jboss.aop.instrument.ClassicInstrumentor</property>
-      -->
-	  <!-- 
-		By default the deployment of the aspects contained in 
-		../deployers/jboss-aop-jboss5.deployer/base-aspects.xml
-		are not deployed. To turn on deployment uncomment this property
-	  <property name="useBaseXml">true</property>
-	  -->
-   </bean>
-
-</deployment>

Copied: projects/aop/trunk/asintegration-core/src/etc/jboss-install-aop.xml (from rev 103034, projects/aop/trunk/asintegration-core/src/etc/jboss-60-install-aop.xml)
===================================================================
--- projects/aop/trunk/asintegration-core/src/etc/jboss-install-aop.xml	                        (rev 0)
+++ projects/aop/trunk/asintegration-core/src/etc/jboss-install-aop.xml	2010-03-26 12:23:42 UTC (rev 103039)
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+   AOP configuration
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <classloader><inject bean="aop-classloader:0.0.0"/></classloader>
+
+   <classloader name="aop-classloader" xmlns="urn:jboss:classloader:1.0" export-all="NON_EMPTY" import-all="true">
+      <root>${jboss.lib.url}jboss-aop-asintegration-core.jar</root>
+      <root>${jboss.lib.url}jboss-aop-asintegration-mc.jar</root>
+      <root>${jboss.lib.url}jboss-aop-deployers.jar</root>
+      <root>${jboss.lib.url}jboss-aop-jboss5.jar</root>
+      <root>${jboss.lib.url}jboss-classpool.jar</root>
+      <root>${jboss.lib.url}jboss-classpool-jbosscl.jar</root>
+      <root>${jboss.lib.url}jboss-deployers-impl.jar</root>
+   </classloader>
+
+   <!-- Integration -->
+   <bean name="AOPClassLoaderScopingPolicy" class="org.jboss.aop.asintegration.jboss5.VFSClassLoaderScopingPolicy"/>
+   
+   <bean name="AOPClassPoolFactory" class="org.jboss.classpool.plugins.jbosscl.JBossClDelegatingClassPoolFactory">
+      <constructor>
+         <parameter><inject bean="AOPClassLoaderScopingPolicy" property="registry"/></parameter>
+         <parameter><inject bean="AOPRegisterModuleCallback"/></parameter>
+      </constructor>
+   </bean>
+
+   <bean name="AOPJBossIntegration" class="org.jboss.aop.asintegration.jboss5.JBoss5Integration">
+      <property name="classPoolFactory"><inject bean="AOPClassPoolFactory"/></property>
+      <property name="aopClassLoaderScopingPolicy"><inject bean="AOPClassLoaderScopingPolicy"/></property>
+   </bean>
+
+   <bean name="DefaultAspectManager" class="org.jboss.aop.microcontainer.beans.metadata.DefaultAspectManager">
+      <property name="managerBean">AspectManager</property>
+      <property name="managerProperty">aspectManager</property>
+   </bean>
+
+   <!-- bean name="AOPBootstrap" class="org.jboss.aop.asintegration.jboss5.AOPBootstrap" -->
+      <!--  This one lives in AS 5 source tree -->
+      <!-- property name="policy"><inject bean="AOPClassLoaderScopingPolicy"/></property>
+       <property name="manager"><inject bean="AspectManager" property="aspectManager"/></property>
+   </bean-->
+
+<bean name="ClassLoaderDomainRegistry" class="org.jboss.aop.asintegration.jboss5.AOPVFSClassLoaderDomainRegistry">
+     <constructor factoryMethod="getRegistry">
+	<factory bean="AOPClassLoaderScopingPolicy"/>
+     </constructor>
+        </bean>
+
+
+   <bean name="AOPRegisterModuleCallback" class="org.jboss.classpool.plugins.jbosscl.RegisterModuleCallback">
+      <!-- classloader><null/></classloader -->
+     <constructor>
+            <parameter><inject bean="ClassLoaderDomainRegistry"/></parameter>
+                 </constructor>
+                      <install method="addModuleRegistry" bean="ClassLoading" whenRequired="Start">
+                             <parameter><this/></parameter>
+                                  </install>
+                                  <install method="addModule">
+                                    <parameter><inject bean="bootstrap-classloader:0.0.0$MODULE"/></parameter>
+                                  </install>
+<!--                                  <install method="addModule" -->
+                                       <uninstall method="removeModuleRegistry" bean="ClassLoading" whenRequired="Start">
+                                              <parameter><this/></parameter>
+                                                   </uninstall>
+                                                     </bean>
+
+
+
+<!--
+      Valid values for the AspectManager bean for use with enableTransformer=true are:
+      * org.jboss.aop.deployers.AspectManagerJDK5 - works with the -javaagent:pluggable-instrumentor.jar switch
+      * org.jboss.aop.deployers.AspectManagerJRockit - works with JRockit and the -Xmanagement:class=org.jboss.aop.hook.JRockitPluggableClassPreProcessor switch
+   -->
+   <bean name="AspectManager" class="org.jboss.aop.deployers.AspectManagerJDK5">
+      <constructor>
+         <parameter><![CDATA[
+	         <aop>
+			      <aspect name="mainDeployer" class="org.jboss.profileservice.aop.MainDeployerAspect"/>
+					   <bind pointcut="execution(* $instanceof{org.jboss.deployers.spi.deployment.MainDeployer}->process(..))">
+				      <advice name="process" aspect="mainDeployer"/>
+				   </bind>
+					<aspect name="persist" class="org.jboss.profileservice.aop.PersistAspect"/>
+					<bind pointcut="execution(* $instanceof{org.jboss.managed.api.ManagedProperty}->setValue(..))">
+				      <advice name="setValue" aspect="persist"/>
+				   </bind>
+				</aop>]]>
+	      </parameter>
+      </constructor>
+
+      <property name="jbossIntegration"><inject bean="AOPJBossIntegration"/></property>
+
+      <property name="enableLoadtimeWeaving">false</property>
+      <!-- only relevant when EnableLoadtimeWeaving is true.
+           When transformer is on, every loaded class gets
+           transformed.  If AOP can't find the class, then it
+           throws an exception.  Sometimes, classes may not have
+           all the classes they reference.  So, the Suppressing
+           is needed.  (i.e. Jboss cache in the default configuration -->
+      <property name="suppressTransformationErrors">true</property>
+      <property name="prune">true</property>
+      <property name="include">org.jboss.test., org.jboss.injbossaop.</property>
+      <property name="exclude">org.jboss.</property>
+      <!-- This avoids instrumentation of hibernate cglib enhanced proxies
+      <property name="ignore">*$$EnhancerByCGLIB$$*</property> -->
+      <property name="optimized">true</property>
+      <property name="verbose">false</property>
+      <!--
+         Available choices for this attribute are:
+            org.jboss.aop.instrument.ClassicInstrumentor (default)
+            org.jboss.aop.instrument.GeneratedAdvisorInstrumentor
+       <property name="instrumentor">org.jboss.aop.instrument.ClassicInstrumentor</property>
+      -->
+	  <!-- 
+		By default the deployment of the aspects contained in 
+		../deployers/jboss-aop-jboss5.deployer/base-aspects.xml
+		are not deployed. To turn on deployment uncomment this property
+	  <property name="useBaseXml">true</property>
+	  -->
+   </bean>
+
+</deployment>

Modified: projects/aop/trunk/asintegration-core/src/etc/jboss.properties
===================================================================
--- projects/aop/trunk/asintegration-core/src/etc/jboss.properties	2010-03-26 12:13:24 UTC (rev 103038)
+++ projects/aop/trunk/asintegration-core/src/etc/jboss.properties	2010-03-26 12:23:42 UTC (rev 103039)
@@ -3,3 +3,5 @@
 jboss.home=/Users/kabir/sourcecontrol/jbossas/Branch_5_x/build/output/jboss-5.1.0.Beta1
 #Set the server configuration you want to patch here (e.g, all or default)
 jboss.config=all
+#Set this to false if you don't want to have backups of the files edited by the install script
+backup=true
\ No newline at end of file

Modified: projects/aop/trunk/build/build.xml
===================================================================
--- projects/aop/trunk/build/build.xml	2010-03-26 12:13:24 UTC (rev 103038)
+++ projects/aop/trunk/build/build.xml	2010-03-26 12:23:42 UTC (rev 103039)
@@ -317,18 +317,25 @@
     <!-- Now pull everything together                        -->
     <!-- ==================================================  -->
 
+    <property name="aop.asintegration-mc.name" value="jboss-aop-asintegration-mc.jar"/>
+    <property name="aop.deployers.name" value="jboss-aop-deployers.jar"/>
     <property name="aop.50.location" value="${project.root}/aop/target/lib/jboss-aop.jar"/>
     <property name="aop.50.single.location" value="${project.root}/aop/target/lib/jboss-aop-single.jar"/>
     <property name="aop.aspect-library50.location" value="${project.root}/aspects/target/jboss-aop-aspects.jar"/>
     <property name="aop.asintegration-core.location" value="${project.root}/asintegration-core/target/jboss-aop-asintegration-core.jar"/>
     <property name="aop.asintegration-jmx.location" value="${project.root}/asintegration-jmx/target/jboss-aop-asintegration-jmx.jar"/>
-    <property name="aop.asintegration-mc.location" value="${project.root}/asintegration-mc/target/jboss-aop-asintegration-mc.jar"/>
+    <property name="aop.asintegration-mc.location" value="${project.root}/asintegration-mc/target/${aop.asintegration-mc.name}"/>
+    <property name="aop.as5integration-mc.location" value="${project.root}/as5integration/target/jboss-aop-as5integration-mc.jar"/>
+    <property name="aop.as5integration-deployers.location" value="${project.root}/as5integration/target/jboss-aop-as5integration-deployers.jar"/>
     <property name="aop.pluggable-instrumentor.location" value="${project.root}/pluggable-instrumentor/target/pluggable-instrumentor.jar"/>
-    <property name="aop.deployers.location" value="${project.root}/deployers/target/jboss-aop-deployers.jar"/>
+    <property name="aop.deployers.location" value="${project.root}/deployers/target/${aop.deployers.name}"/>
     <property name="aop.readme-as4.location" value="${project.root}/asintegration-core/src/etc/ReadMe-AS4.txt"/>
     <property name="aop.readme-as5.location" value="${project.root}/asintegration-core/src/etc/ReadMe-AS5.txt"/>
     <property name="aop.readme-as6.location" value="${project.root}/asintegration-core/src/etc/ReadMe-AS6.txt"/>
-    <property name="aop.jboss-service.location" value="${project.root}/asintegration-jmx/src/resources/META-INF/jboss-service.xml"/>
+    <property name="aop.jboss-service.location" value="${project.root}/asintegration-jmx/src/resources/META-INF/jboss-service.xml"/>
+    <property name="jboss-install-aop.xml.location" value="${project.root}/asintegration-core/src/etc/jboss-install-aop.xml"/>
+    <property name="jboss-50-run.conf.location" value="${project.root}/asintegration-core/src/etc/jboss-50-run.conf"/>
+    <property name="jboss-50-run.conf.bat.location" value="${project.root}/asintegration-core/src/etc/jboss-50-run.conf.bat"/>
 
     <!-- Copy across the eula -->
     <copy todir="${project.release}" file="${project.root}/aop/src/etc/jbossorg-eula.txt"/>
@@ -377,7 +384,11 @@
     <!-- The JBoss 5 libs for JDK 5 (JBoss 5 needs JDK 5) -->
     <copy todir="${project.release}/jboss-50-install/lib" file="${aop.50.location}"/>
     <copy todir="${project.release}/jboss-50-install/lib" file="${aop.asintegration-core.location}"/>
-    <copy todir="${project.release}/jboss-50-install/lib" file="${aop.asintegration-mc.location}"/>
+    <copy todir="${project.release}/jboss-50-install/lib">
+      <fileset dir="${project.root}/as5integration/target/as5-install">
+         <include name="*.jar"/>
+      </fileset>
+    </copy>
     <copy todir="${project.release}/jboss-50-install/lib" file="${aop.asintegration-jmx.location}"/>
     <copy todir="${project.release}/jboss-50-install" file="${aop.readme-as5.location}"/>
     <copy tofile="${project.release}/jboss-50-install/build.xml" file="../asintegration-core/src/etc/jboss-50-install-jboss-aop-jdk50-build.xml"/>
@@ -386,6 +397,9 @@
     <copy tofile="${project.release}/jboss-50-install/lib/trove.jar" file="${trove:trove:jar}"/>
     <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/" file="${aop.pluggable-instrumentor.location}"/>
+    <copy tofile="${project.release}/jboss-50-install/aop.xml" file="${jboss-install-aop.xml.location}"/>
+    <copy tofile="${project.release}/jboss-50-install/append-run.conf" file="${jboss-50-run.conf.location}"/>
+    <copy tofile="${project.release}/jboss-50-install/append-run.conf.bat" file="${jboss-50-run.conf.bat.location}"/>
 
     <!-- The JBoss 6 libs for JDK 6 (JBoss 6 needs JDK6) -->
     <copy todir="${project.release}/jboss-60-install/lib" file="${aop.50.location}"/>
@@ -393,7 +407,7 @@
     <copy todir="${project.release}/jboss-60-install/lib" file="${aop.asintegration-mc.location}"/>
     <copy todir="${project.release}/jboss-60-install" file="${aop.readme-as6.location}"/>
     <copy tofile="${project.release}/jboss-60-install/build.xml" file="../asintegration-core/src/etc/jboss-60-install-jboss-aop-build.xml"/>
-    <copy tofile="${project.release}/jboss-60-install/aop.xml" file="../asintegration-core/src/etc/jboss-60-install-aop.xml"/>
+    <copy tofile="${project.release}/jboss-60-install/aop.xml" file="${jboss-install-aop.xml.location}"/>
     <copy todir="${project.release}/jboss-60-install" file="../asintegration-core/src/etc/jboss.properties"/>
     <copy tofile="${project.release}/jboss-60-install/lib/javassist.jar" file="${javassist:javassist:jar}"/>
     <copy tofile="${project.release}/jboss-60-install/lib/jboss-classpool-scoped.jar" file="${org.jboss.classpool:jboss-classpool-scoped:jar}"/>

Modified: projects/aop/trunk/pom.xml
===================================================================
--- projects/aop/trunk/pom.xml	2010-03-26 12:13:24 UTC (rev 103038)
+++ projects/aop/trunk/pom.xml	2010-03-26 12:23:42 UTC (rev 103039)
@@ -88,6 +88,7 @@
     <module>asintegration-core</module>
     <module>asintegration-jmx</module>
     <module>asintegration-mc</module>
+    <module>as5integration</module>
     <module>aophelper</module>
     <module>deployers</module>
     <module>build</module>
@@ -209,6 +210,11 @@
         <version>${project.version}</version>
       </dependency>
       <dependency>
+        <groupId>org.jboss.aop</groupId>
+        <artifactId>jboss-aop-deployers</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
         <groupId>org.jboss.cl</groupId>
         <artifactId>jboss-classloader</artifactId>
         <version>${version.org.jboss.cl}</version>




More information about the jboss-cvs-commits mailing list