[jboss-cvs] JBossAS SVN: r68601 - in projects/aop/branches/joinpoint_graph: aop and 19 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jan 3 10:50:51 EST 2008


Author: flavia.rainone at jboss.com
Date: 2008-01-03 10:50:50 -0500 (Thu, 03 Jan 2008)
New Revision: 68601

Added:
   projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/OtherAnnotation.java
   projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/OtherMD.java
   projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/OtherMDImpl.java
   projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/SomeAnnotation.java
   projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/SomeMD.java
   projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/SomeMDImpl.java
   projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/
   projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/Base.java
   projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/Child.java
   projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/ChildInterface.java
   projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/SuperClassIsAdvisedByProxyTestCase.java
   projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/TestInterceptor.java
Removed:
   projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/Base.java
   projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/Child.java
   projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/ChildInterface.java
   projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/SuperClassIsAdvisedByProxyTestCase.java
   projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/TestInterceptor.java
Modified:
   projects/aop/branches/joinpoint_graph/aop/build-tests-jdk14.xml
   projects/aop/branches/joinpoint_graph/aop/build.xml
   projects/aop/branches/joinpoint_graph/aop/pom.xml
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/AdviceType.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/Advised.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/Advisor.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/AspectManager.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/GeneratedAdvised.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/InstanceAdvised.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/InstanceAdvisor.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/SecurityActions.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/SuperClassesFirstWeavingStrategy.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/advice/AdviceBinding.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/advice/AdviceType.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/advice/AspectDefinition.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/advice/AspectFactory.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/advice/Interceptor.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/advice/Scope.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/array/ArrayBinding.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/classpool/AOPClassPool.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/instrument/GeneratedAdvisorInstrumentor.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/instrument/Instrumentor.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/instrument/JoinPointGenerator.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/instrument/MethodJoinPointGenerator.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/instrument/NonOptimizedFieldAccessTransformer.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/joinpoint/Joinpoint.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/metadata/MetaDataResolver.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/metadata/SimpleMetaData.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/proxy/container/ContainerProxyFactory.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/proxy/container/ProxyTemplate.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/util/MarshalledValue.java
   projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/util/PayloadKey.java
   projects/aop/branches/joinpoint_graph/aop/src/resources/test/annotationoverride/jboss-aop.xml
   projects/aop/branches/joinpoint_graph/aop/src/resources/test/nameddomain/jboss-aop.xml
   projects/aop/branches/joinpoint_graph/aop/src/resources/test/regression/jboss-aop.xml
   projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/AnnotationOverrideTestCase.java
   projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/Woven.java
   projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/rebuildingchain/RebuildThread.java
   projects/aop/branches/joinpoint_graph/asintegration/
   projects/aop/branches/joinpoint_graph/build/RELEASE_NOTES.html
   projects/aop/branches/joinpoint_graph/build/build-thirdparty.xml
   projects/aop/branches/joinpoint_graph/pom.xml
   projects/aop/branches/joinpoint_graph/tools/etc/buildmagic/buildmagic.ent
Log:
Merging trunk changes to this branch.

Modified: projects/aop/branches/joinpoint_graph/aop/build-tests-jdk14.xml
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/build-tests-jdk14.xml	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/build-tests-jdk14.xml	2008-01-03 15:50:50 UTC (rev 68601)
@@ -163,8 +163,8 @@
          <pathelement path="${local.classpath}"/>
          <path refid="thirdparty.classpath"/>
          <path refid="jboss.test14.classpath"/>
-         <path refid="jboss.microcontainer.classpath"/>
-         <path refid="jboss/common.core.classpath"/>
+         <path refid="jboss.microcontainer14.classpath"/>
+         <path refid="jboss/common.core.14.classpath"/>
          <pathelement path="${build.lib}/jboss-aop-jdk50.jar"/>
          <path refid="junit.junit.classpath"/>
       </path>
@@ -307,12 +307,12 @@
       <antcall target="clean"/>
       <antcall target="bootclasspath-genadvisor-tests" inheritRefs="true"/>
       <antcall target="bootclasspath-tests" inheritRefs="true"/>
-      <antcall target="system-classloader-test" inheritRefs="true"/>
       <antcall target="not-woven-tests" inheritRefs="true"/>
 
       <antcall target="clean"/>
       <antcall target="precompiled-tests" inheritRefs="true"/>
-
+     <antcall target="system-classloader-test" inheritRefs="true"/>
+ 
       <antcall target="clean"/>
       <antcall target="precompiled-genadvisor-tests" inheritRefs="true"/>
 

Modified: projects/aop/branches/joinpoint_graph/aop/build.xml
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/build.xml	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/build.xml	2008-01-03 15:50:50 UTC (rev 68601)
@@ -513,4 +513,112 @@
       </jar>
    </target>
 
+   <!-- Copied from buildmagic and edited -->
+   <target name="public-api" depends="_buildmagic:init">
+      
+      <property name="build.public.api" value="${module.output}/public_api"/>
+      
+      <javadoc sourcepath="${source.java}"
+          destdir="${build.public.api}"
+          classpathref="javac.classpath"
+          windowtitle="${javadoc.windowtitle}"
+          splitindex="${javadoc.splitindex}"
+          author="${javadoc.author}"
+          version="${javadoc.version}"
+          public="${javadoc.public}"
+          package="${javadoc.package}"
+          protected="${javadoc.protected}"
+          private="${javadoc.private}"
+          use="${javadoc.use}"
+          verbose="${javadoc.verbose}">
+          <doctitle><![CDATA[<h1>${module.Name} Final User API Documentation</h1>]]></doctitle>
+          <bottom><![CDATA[
+            <i>
+            <div align="center">
+              <font size="-1">Copyright &#169; 2004 JBoss Inc. All Rights Reserved.</font>
+            </div>
+            </i>
+          ]]></bottom>
+         <source file="${source.java}/org/jboss/aop/AdviceType.java"/>
+         <source file="${source.java}/org/jboss/aop/Advised.java"/>
+         <source file="${source.java}/org/jboss/aop/Advisor.java"/>
+         <source file="${source.java}/org/jboss/aop/AnnotationIntroductionDef.java"/>
+         <source file="${source.java}/org/jboss/aop/Aspect.java"/>
+         <source file="${source.java}/org/jboss/aop/AspectManager.java"/>
+         <source file="${source.java}/org/jboss/aop/CallerConstructorInfo.java"/>
+         <source file="${source.java}/org/jboss/aop/CallerMethodInfo.java"/>
+         <source file="${source.java}/org/jboss/aop/CFlowDef.java"/>
+         <source file="${source.java}/org/jboss/aop/CFlowStackDef.java"/>
+         <source file="${source.java}/org/jboss/aop/ClassAdvisor.java"/><!--?? Keep this one??? -->
+         <source file="${source.java}/org/jboss/aop/ConByConInfo.java"/>
+         <source file="${source.java}/org/jboss/aop/ConByMethodInfo.java"/>
+         <source file="${source.java}/org/jboss/aop/ConstructionInfo.java"/>
+         <source file="${source.java}/org/jboss/aop/ConstructorInfo.java"/>
+         <source file="${source.java}/org/jboss/aop/DeclareError.java"/>
+         <source file="${source.java}/org/jboss/aop/DeclareWarning.java"/>
+         <source file="${source.java}/org/jboss/aop/Domain.java"/>
+         <source file="${source.java}/org/jboss/aop/DomainDefinition.java"/> <!-- Keep this one?? -->
+         <source file="${source.java}/org/jboss/aop/DynamicCFlowDef.java"/>
+         <source file="${source.java}/org/jboss/aop/FieldInfo.java"/>
+         <source file="${source.java}/org/jboss/aop/MethodByConInfo.java"/>
+         <source file="${source.java}/org/jboss/aop/MethodByMethodInfo.java"/>
+         <source file="${source.java}/org/jboss/aop/MethodInfo.java"/>
+         <source file="${source.java}/org/jboss/aop/GeneratedAdvised.java"/>
+         <source file="${source.java}/org/jboss/aop/InstanceAdvised.java"/>
+         <source file="${source.java}/org/jboss/aop/InstanceAdvisor.java"/>
+         <source file="${source.java}/org/jboss/aop/InstanceDomain.java"/> <!--?? Keep this one here?? -->
+         <source file="${source.java}/org/jboss/aop/Introduction.java"/>
+         <source file="${source.java}/org/jboss/aop/Mixin.java"/>
+         <source file="${source.java}/org/jboss/aop/PointcutDef.java"/>
+         <source file="${source.java}/org/jboss/aop/Precedence.java"/>
+         <source file="${source.java}/org/jboss/aop/PrecedenceAdvice.java"/>
+         <source file="${source.java}/org/jboss/aop/PrecedenceInterceptor.java"/>
+         <source file="${source.java}/org/jboss/aop/Prepare.java"/>
+         <source file="${source.java}/org/jboss/aop/TypeDef.java"/>
+         <source file="${source.java}/org/jboss/aop/advice/AdviceBinding.java"/>
+         <source file="${source.java}/org/jboss/aop/advice/AdviceFactory.java"/>
+         <source file="${source.java}/org/jboss/aop/advice/AspectDefinition.java"/>
+         <source file="${source.java}/org/jboss/aop/advice/AspectFactory.java"/>
+         <source file="${source.java}/org/jboss/aop/advice/GenericAspectFactory.java"/>
+         <source file="${source.java}/org/jboss/aop/advice/GenericInterceptorFactory.java"/>
+         <source file="${source.java}/org/jboss/aop/advice/Interceptor.java"/>
+         <source file="${source.java}/org/jboss/aop/advice/InterceptorFactory.java"/>
+         <source file="${source.java}/org/jboss/aop/advice/InvalidAdviceException.java"/>
+         <source file="${source.java}/org/jboss/aop/advice/NoMatchingAdviceException.java"/>
+         <source file="${source.java}/org/jboss/aop/advice/Scope.java"/>
+         <source file="${source.java}/org/jboss/aop/advice/annotation/Arg.java"/>
+         <source file="${source.java}/org/jboss/aop/advice/annotation/Args.java"/>
+         <source file="${source.java}/org/jboss/aop/advice/annotation/Caller.java"/>
+         <source file="${source.java}/org/jboss/aop/advice/annotation/JoinPoint.java"/>
+         <source file="${source.java}/org/jboss/aop/advice/annotation/Return.java"/>
+         <source file="${source.java}/org/jboss/aop/advice/annotation/Target.java"/>
+         <source file="${source.java}/org/jboss/aop/advice/annotation/Thrown.java"/>
+         <source file="${source.java}/org/jboss/aop/annotation/compiler/AnnotationCompiler.java"/> <!-- ?? Investigate more on this package before decide what to keep here -->
+         <source file="${source.java}/org/jboss/aop/ant/AnnotationC.java"/>
+         <source file="${source.java}/org/jboss/aop/ant/AopC.java"/>
+         <source file="${source.java}/org/jboss/aop/joinpoint/CallerInvocation.java"/>
+         <source file="${source.java}/org/jboss/aop/joinpoint/ConstructionInvocation.java"/>
+         <source file="${source.java}/org/jboss/aop/joinpoint/ConstructorCalledByConstructorInvocation.java"/>
+         <source file="${source.java}/org/jboss/aop/joinpoint/ConstructorCalledByMethodInvocation.java"/>
+         <source file="${source.java}/org/jboss/aop/joinpoint/ConstructorInvocation.java"/>
+         <source file="${source.java}/org/jboss/aop/joinpoint/CurrentInvocation.java"/>
+         <source file="${source.java}/org/jboss/aop/joinpoint/FieldInvocation.java"/>
+         <source file="${source.java}/org/jboss/aop/joinpoint/FieldReadInvocation.java"/>
+         <source file="${source.java}/org/jboss/aop/joinpoint/FieldWriteInvocation.java"/>
+         <source file="${source.java}/org/jboss/aop/joinpoint/Invocation.java"/>
+         <source file="${source.java}/org/jboss/aop/joinpoint/Joinpoint.java"/>
+         <source file="${source.java}/org/jboss/aop/joinpoint/MethodCalledByConstructorInvocation.java"/>
+         <source file="${source.java}/org/jboss/aop/joinpoint/MethodCalledByMethodInvocation.java"/>
+         <source file="${source.java}/org/jboss/aop/joinpoint/MethodInvocation.java"/>
+         <source file="${source.java}/org/jboss/aop/metadata/SimpleMetaData.java"/>
+         <!-- TODO add metadata binding here -->
+         <source file="${source.java}/org/jboss/aop/pointcut/DynamicCFlow.java"/>
+         <source file="${source.java}/org/jboss/aop/pointcut/Pointcut.java"/>
+         <source file="${source.java}/org/jboss/aop/pointcut/ast/ParseException.java"/>
+         
+         
+         <link href="http://java.sun.com/j2se/1.5.0/docs/api/"/>
+      </javadoc>
+   </target>
+
 </project>

Modified: projects/aop/branches/joinpoint_graph/aop/pom.xml
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/pom.xml	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/pom.xml	2008-01-03 15:50:50 UTC (rev 68601)
@@ -10,7 +10,7 @@
   <groupId>org.jboss.aop</groupId>
   <artifactId>jboss-aop</artifactId>
   <packaging>jar</packaging>
-  <version>2.0.0-SNAPSHOT</version>
+  <version>2.0.0.CR1</version>
   <name>JBoss AOP</name>
   <description>JBoss AOP Framework</description>
   <url>http://labs.jboss.org/jbossaop</url>
@@ -343,17 +343,17 @@
     <dependency>
       <groupId>org.jboss</groupId>
       <artifactId>javassist</artifactId>
-      <version>3.6.0.CR1</version>
+      <version>3.6.0.GA</version>
     </dependency>
     <dependency>
       <groupId>org.jboss.microcontainer</groupId>
       <artifactId>jboss-container</artifactId>
-      <version>2.0.0-SNAPSHOT</version>
+      <version>2.0.0.Beta6</version>
     </dependency>
     <dependency>
-      <groupId>jboss</groupId>
+      <groupId>org.jboss</groupId>
       <artifactId>jboss-common-core</artifactId>
-      <version>2.2.0.GA</version>
+      <version>2.2.2.GA</version>
     </dependency>
     <dependency>
       <groupId>jboss</groupId>

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/AdviceType.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/AdviceType.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/AdviceType.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -1,31 +1,66 @@
 /*
-* 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.
-*/ 
+ * 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;
 
 /**
+ * Indicates whether the type of an advice is <i>before</i>, <i>around</i>,
+ * <i>after</i>, <i>throwing</i> or <i>finally</i>.
+ * <br>
+ * Notice that interceptors are a special type of <i>around</i> advices.
+ * <br>Use this class to specify the type of the advice on a
+ * {@link org.jboss.aop.Bind} annotation.
  * 
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
  * @version $Revision: 1.1 $
+ * @see org.jboss.aop.Bind
  */
 public enum AdviceType {
-   AROUND, BEFORE, AFTER, THROWING, FINALLY;
-}
+   /**
+    * Advice will be invoked before the joinpoint execution.
+    */
+   AROUND,
+   
+   /**
+    * Advice will be invoked around the joinpoint execution, and as such is
+    * responsible for invoking the next advice in the chain and returning the
+    * joinpoint result value.
+    */
+   BEFORE,
+   
+   /**
+    * Advice will be invoked after the joinpoint execution, only if it returns
+    * normally.
+    */
+   AFTER,
+   
+   /**
+    * Advice will be invoked after the joinpoint execution, only if it throws an
+    * exception.
+    */
+   THROWING,
+   
+   /**
+    * Advice will be invoked after the joinpoint execution, regardless of how it
+    * returns.
+    */
+   FINALLY;
+}
\ No newline at end of file

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/Advised.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/Advised.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/Advised.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -1,29 +1,32 @@
 /*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., 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.
-  */
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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;
 
 /**
- * This interface is implemented by all classes or interfaces
- * that are AOP enabled
+ * Interface implemented by all classes or interfaces
+ * that are AOP enabled (those are also known as advised classes/interfaces).
+ * <br>
+ * In other words, every class that is weaved by JBoss AOP automatically implements
+ * this interface, which allows the class and instance advisor retrieval.
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  * @version $Revision$
@@ -31,8 +34,10 @@
 public interface Advised extends InstanceAdvised
 {
    /**
-    * Return the manager.  Usually this just returns
-    * a ClassAdvisor.
+    * Returns the manager, also known as advisor, of the weaved class. 
+    * 
+    * @return the advisor of the weaved class. Usually this just returns
+    * a {@link ClassAdvisor}.
     */
    public Advisor _getAdvisor();
-}
+}
\ No newline at end of file

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/Advisor.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/Advisor.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/Advisor.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -72,6 +72,8 @@
 import org.jboss.aop.pointcut.PointcutMethodMatch;
 import org.jboss.aop.util.UnmodifiableEmptyCollections;
 import org.jboss.metadata.spi.MetaData;
+import org.jboss.metadata.spi.signature.ConstructorSignature;
+import org.jboss.metadata.spi.signature.FieldSignature;
 import org.jboss.metadata.spi.signature.MethodSignature;
 import org.jboss.util.NestedRuntimeException;
 import org.jboss.util.NotImplementedException;
@@ -343,8 +345,6 @@
       if (metadata != null)
       {
          Object value = metadata.getAnnotation(annotation);
-         // FIXME The metadata should already include the class annotations
-         //       so we should just return this result
          if (value != null) return value;
       }
 
@@ -353,7 +353,10 @@
 
       Object value = annotations.resolveClassAnnotation(annotation);
       if (clazz == null) return null;
-      if (value == null) value = AnnotationElement.getVisibleAnnotation(clazz, annotation);
+      if (value == null && metadata == null)
+      {
+         value = AnnotationElement.getVisibleAnnotation(clazz, annotation);
+      }
       return value;
    }
 
@@ -385,12 +388,14 @@
          {
             if (annotationClass == null)
             {
-               // FIXME ClassLoader - this should use "tgt.getClassLoader()"
-               annotationClass = SecurityActions.getContextClassLoader().loadClass(annotation);
+               ClassLoader cl = SecurityActions.getClassLoader(tgt);
+               if (cl == null)
+               {
+                  cl = SecurityActions.getContextClassLoader();
+               }
+               annotationClass = cl.loadClass(annotation);
             }
-            // FIXME The metadata should already include the class annotations
-            //       so we should just return this result
-            if (metadata.isAnnotationPresent(annotationClass)) return true;
+            if (annotationClass != null && metadata.isAnnotationPresent(annotationClass)) return true;
          }
       }
       catch (ClassNotFoundException e)
@@ -407,12 +412,16 @@
       if (tgt == null) return false;
       try
       {
-         return AnnotationElement.isAnyAnnotationPresent(tgt, annotation);
+         if (metadata == null)
+         {
+            return AnnotationElement.isAnyAnnotationPresent(tgt, annotation);
+         }
       }
       catch (Exception e)
       {
          throw new RuntimeException(e);  //To change body of catch statement use Options | File Templates.
       }
+      return false;
    }
 
    public Object resolveAnnotation(Method m, Class annotation)
@@ -428,8 +437,6 @@
          MetaData methodMD = metadata.getComponentMetaData(signature);
          if (methodMD != null)
          {
-            // FIXME The metadata should already include the class annotations
-            //       so we should just return this result
             Object val = methodMD.getAnnotation(annotation);
             if (val != null) return val;
          }
@@ -439,36 +446,64 @@
          return null;
 
       Object value = annotations.resolveAnnotation(m, annotation);
-      if (value == null) value = AnnotationElement.getVisibleAnnotation(m, annotation);
+      if (value == null && metadata == null) 
+      {
+         value = AnnotationElement.getVisibleAnnotation(m, annotation);
+      }
       return value;
    }
 
    public Object resolveAnnotation(Method m, Class[] annotationChoices)
    {
-      Object value = null;
-      int i = 0;
-      while (value == null && i < annotationChoices.length){
-         value = annotations.resolveAnnotation(m, annotationChoices[i++]);
+      for (Class ann : annotationChoices)
+      {
+         Object val = resolveAnnotation(m, annotationChoices);
+         if (val != null) return val;
       }
-
-      i = 0;
-      while (value == null && i < annotationChoices.length){
-         value = AnnotationElement.getVisibleAnnotation(m, annotationChoices[i++]);
-      }
-      return value;
+      return null;
    }
 
    public Object resolveAnnotation(Field f, Class annotation)
    {
-      Object value = annotations.resolveAnnotation(f, annotation);
-      if (value == null) value = AnnotationElement.getVisibleAnnotation(f, annotation);
+      Object value = null;
+      if (metadata != null)
+      {
+         FieldSignature signature = new FieldSignature(f);
+         MetaData fieldMD = metadata.getComponentMetaData(signature);
+         if (fieldMD != null)
+         {
+            value = fieldMD.getAnnotation(annotation);
+            if (value != null) return value;
+         }
+      }
+      
+      value = annotations.resolveAnnotation(f, annotation);
+      if (value == null && metadata == null)
+      {
+         value = AnnotationElement.getVisibleAnnotation(f, annotation);
+      }
       return value;
    }
 
    public Object resolveAnnotation(Constructor c, Class annotation)
    {
-      Object value = annotations.resolveAnnotation(c, annotation);
-      if (value == null) value = AnnotationElement.getVisibleAnnotation(c, annotation);
+      Object value = null;
+      if (metadata != null)
+      {
+         ConstructorSignature signature = new ConstructorSignature(c);
+         MetaData conMD = metadata.getComponentMetaData(signature);
+         if (conMD != null)
+         {
+            value = conMD.getAnnotation(annotation);
+            if (value != null) return value;
+         }
+      }
+      
+      value = annotations.resolveAnnotation(c, annotation);
+      if (value == null && metadata == null)
+      {
+         value = AnnotationElement.getVisibleAnnotation(c, annotation);
+      }
       return value;
    }
 
@@ -489,77 +524,130 @@
          throw new RuntimeException("annotation or annotationClass must be passed in");
       }
 
-      try
+      if (annotation == null)
       {
-         if (metadata != null)
+         annotation = annotationClass.getName();
+      }
+      if (metadata != null)
+      {
+         if (hasJoinPointAnnotation(m.getDeclaringClass(), new MethodSignature(m), annotationClass))
          {
-            if (annotationClass == null)
-            {
-               // FIXME ClassLoader - this should use "m.getClass().getClassLoader()"
-               annotationClass = SecurityActions.getContextClassLoader().loadClass(annotation);
-            }
-            // FIXME The metadata should already include the class annotations
-            //       so we should just return this result
-            MethodSignature signature = new MethodSignature(m.getName(), m.getParameterTypes());
-            MetaData methodMD = metadata.getComponentMetaData(signature);
-            if (methodMD != null)
-            {
-               if (methodMD.isAnnotationPresent(annotationClass))
-                  return true;
-            }
+            return true;
          }
       }
-      catch (ClassNotFoundException e)
+
+      if (annotations.hasAnnotation(m, annotation)) return true;
+      try
       {
-         //The "annotation" is probably aop metadata for which there will be no corresponding class
+         if (metadata == null)
+         {
+            return AnnotationElement.isAnyAnnotationPresent(m, annotation);
+         }
       }
-      catch(Exception e)
+      catch (Exception e)
       {
-         throw new RuntimeException(e);
+         throw new RuntimeException(e);  //To change body of catch statement use Options | File Templates.
       }
+      return false;
+   }
 
-      if (annotation == null)
+   public boolean hasAnnotation(Field m, String annotation)
+   {
+      if (metadata != null)
       {
-         annotation = annotationClass.getName();
+         if (hasJoinPointAnnotationFromStringName(m.getDeclaringClass(), new FieldSignature(m), annotation))
+         {
+            return true;
+         }
       }
-
       if (annotations.hasAnnotation(m, annotation)) return true;
       try
       {
-         return AnnotationElement.isAnyAnnotationPresent(m, annotation);
+         if (metadata == null)
+         {
+            return AnnotationElement.isAnyAnnotationPresent(m, annotation);
+         }
       }
       catch (Exception e)
       {
          throw new RuntimeException(e);  //To change body of catch statement use Options | File Templates.
       }
+      return false;
    }
 
-   public boolean hasAnnotation(Field m, String annotation)
+   public boolean hasAnnotation(Constructor<?> m, String annotation)
    {
+      if (metadata != null)
+      {
+         if (hasJoinPointAnnotationFromStringName(m.getDeclaringClass(), new ConstructorSignature(m), annotation))
+         {
+            return true;
+         }
+      }
       if (annotations.hasAnnotation(m, annotation)) return true;
       try
       {
-         return AnnotationElement.isAnyAnnotationPresent(m, annotation);
+         if (metadata == null)
+         {
+            return AnnotationElement.isAnyAnnotationPresent(m, annotation);
+         }
       }
       catch (Exception e)
       {
          throw new RuntimeException(e);  //To change body of catch statement use Options | File Templates.
       }
+      return false;
    }
 
-   public boolean hasAnnotation(Constructor m, String annotation)
+   private boolean hasJoinPointAnnotationFromStringName(Class declaringClass, org.jboss.metadata.spi.signature.Signature sig, String annotationName)
    {
-      if (annotations.hasAnnotation(m, annotation)) return true;
       try
       {
-         return AnnotationElement.isAnyAnnotationPresent(m, annotation);
+         if (metadata != null)
+         {
+            ClassLoader cl = SecurityActions.getClassLoader(declaringClass);
+            if (cl == null)
+            {
+               cl = SecurityActions.getContextClassLoader();
+            }
+            if (cl != null)
+            {
+               Class annotationClass = cl.loadClass(annotationName);
+               if (annotationClass != null)
+               {
+                  return this.hasJoinPointAnnotation(declaringClass, sig, annotationClass);
+               }
+            }
+         }
       }
-      catch (Exception e)
+      catch (ClassNotFoundException e)
       {
-         throw new RuntimeException(e);  //To change body of catch statement use Options | File Templates.
+         //The "annotation" is probably aop metadata for which there will be no corresponding class
       }
+      catch(Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+      return false;
    }
-
+   
+   private boolean hasJoinPointAnnotation(Class declaringClass, org.jboss.metadata.spi.signature.Signature sig, Class annotationClass)
+   {
+      if (metadata != null)
+      {
+         if (annotationClass != null)
+         {
+            MetaData md = metadata.getComponentMetaData(sig);
+            if (md != null)
+            {
+               if (md.isAnnotationPresent(annotationClass))
+                  return true;
+            }
+         }
+      }
+      return false;
+   }
+   
    public boolean hasAnnotation(CtClass clazz, String annotation)
    {
       if (annotations.hasClassAnnotation(annotation)) return true;

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/AspectManager.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/AspectManager.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/AspectManager.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -916,22 +916,19 @@
          }
          if (weavingStrategy == null)
          {
-//           synchronized (this)
-//            {
-               if (TransformerCommon.isCompileTime() || classicOrder)
-               {
-                  weavingStrategy = new ClassicWeavingStrategy();
-               }
-               else if(InstrumentorFactory.getInstrumentor(this,dynamicStrategy.getJoinpointClassifier())
-                     instanceof GeneratedAdvisorInstrumentor)
-               {
-                  weavingStrategy = new SuperClassesFirstWeavingStrategy();
-               }
-               else
-               {
-                  weavingStrategy = new ClassicWeavingStrategy();
-               }
-//            }
+            if (TransformerCommon.isCompileTime() || classicOrder)
+            {
+               weavingStrategy = new ClassicWeavingStrategy();
+            }
+            else if(InstrumentorFactory.getInstrumentor(this,dynamicStrategy.getJoinpointClassifier())
+                  instanceof GeneratedAdvisorInstrumentor)
+            {
+               weavingStrategy = new SuperClassesFirstWeavingStrategy();
+            }
+            else
+            {
+               weavingStrategy = new ClassicWeavingStrategy();
+            }
          }
 
          return weavingStrategy.translate(this, className, loader, classfileBuffer);
@@ -1626,11 +1623,11 @@
    /**
     * Retrieve an introduction pointcut of a certain name
     */
-   public InterfaceIntroduction getArrayBinding(String name)
+   public ArrayBinding getArrayBinding(String name)
    {
       synchronized (arrayBindings)
       {
-         return (InterfaceIntroduction) arrayBindings.get(name);
+         return (ArrayBinding) arrayBindings.get(name);
       }
    }
 

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/GeneratedAdvised.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/GeneratedAdvised.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/GeneratedAdvised.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -21,7 +21,24 @@
   */
 package org.jboss.aop;
 
+/**
+ * Interface implemented by all classes or interfaces
+ * that are AOP enabled in the generated-advisor mode.
+ * <br>
+ * In other words, every class that is generated-advisor weaved by JBoss AOP
+ * automatically implements  this interface, which allows the domain retrieval.
+ * 
+ * @author  <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ */
 public interface GeneratedAdvised
 {
+   /**
+    * Returns the domain that is associated with this advised object.
+    * This domain contains all the bindings and other AOP configuration that has
+    * been used to weave this instance. Changes performed dynamically on the domain
+    * will automatically become efective on this advised object.
+    * 
+    * @return the domain where this advised object belongs.
+    */
    AspectManager getDomain();
-}
+}
\ No newline at end of file

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/InstanceAdvised.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/InstanceAdvised.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/InstanceAdvised.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -1,37 +1,49 @@
 /*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., 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.
-  */
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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;
 
 /**
- * This is implemented by objects that
- * can have per-instance interceptors or metadata.
- * proxies and instances of AOP'd classes implement
- * this interface
+ * Automatically implemented by every AOP-generated proxy and weaved class.
+ *<br>
+ * This allows the retrieval of the instance advisor, so you can dynamically bind
+ * per-instance interceptors and metadata.
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  * @version $Revision$
+ * @see InstanceAdvisor
  */
 public interface InstanceAdvised
 {
+   /**
+    * Returns the {@link Advisor} associated with this weaved instance.
+    * 
+    * @return the advisor or manager of this weaved object.
+    */
    public InstanceAdvisor _getInstanceAdvisor();
+   
+   /**
+    * Sets the instance advisor associated with this weaved instance.
+    * 
+    * @param newAdvisor the new advisor or manager of this weaved object.
+    */
    public void _setInstanceAdvisor(InstanceAdvisor newAdvisor);
-}
+}
\ No newline at end of file

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/InstanceAdvisor.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/InstanceAdvisor.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/InstanceAdvisor.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -27,53 +27,201 @@
 import org.jboss.aop.metadata.SimpleMetaData;
 
 /**
- * Holds an object instance's metadata and attached interceptors
- *
+ * Holds an object instance's metadata and attached interceptor chain.
+ * <br>
+ * The interceptor chain attached to an advised object contains interceptors that are
+ * applied to every method execution and field access joinpoint of that object.
+ * At startup, the instance interceptor chain is always empty. This chain is
+ * specially tailored for per-instance dynamic AOP operations, allowing the addition
+ * and removal of interceptors at runtime. The order in which the interceptors are
+ * invoked depends on which method was used to add them to the chain (for more
+ * information, see {@link #insertInterceptor } and {@link #appendInterceptor}
+ * methods). 
+ * <br>
+ * Notice that every interceptor chain operation provided by an instance
+ * advisor affects only the advised object interceptor chain, and hence it will not
+ * affect other advised instances, regardless of whether they belong to the same
+ * class or not. 
+ * 
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  * @version $Revision$
  */
 public interface InstanceAdvisor
 {
+   /**
+    * Returns the metadata bound to the advised instance.
+    * 
+    * @return the metadata bound to the advised instance.
+    */
    public SimpleMetaData getMetaData();
 
+   /**
+    * Returns the domain where this advisor belongs. The domain contains all the
+    * configured AOP features (like bindings, aspects, and introductions) that should
+    * be applied to the advised instance.
+    * 
+    * @return the domain bound to this advisor
+    */
+   public Domain getDomain();
+   
+   /**
+    * Returns the advised instance managed by this advisor.
+    * 
+    * @return the advised instance
+    */
+   public Object getInstance();
+   
+   /**
+    * Indicates if the advised instance interceptor chain is not empty.
+    * 
+    * @return {@code true} if the advised instance interceptor chain contains one
+    *         or more elements.
+    */
    public boolean hasInterceptors(); 
    
-   public Interceptor[] getInterceptors();
-
-   public Interceptor[] getInterceptors(Interceptor[] baseChain);
-
+   /**
+    * Indicates whether there are instance aspects bound to the instance advised.
+    * In other words, this method returns the same as {@link #hasInterceptors()}.
+    * 
+    * @return {@code true} if there is one or more aspects bound to this advised
+    *         instance.
+    */
    public boolean hasAspects();
 
+   /**
+    * Inserts an interceptor at the beginning of the instance's interceptor chain.
+    * 
+    * @param interceptor the interceptor to be added to the instance's chain.
+    */
    public void insertInterceptor(Interceptor interceptor);
 
-   public void removeInterceptor(String name);
+   /**
+    * Inserts an interceptor at position {@code index} of the inserted instance's
+    * interceptor chain.
+    * 
+    * @param index the position where to insert {@code interceptor}. This value must
+    *        not be greater than or equal to the number of inserted interceptors in
+    *        the chain.
+    * @param interceptor the interceptor to be added to the instance's chain.
+    * @throws IndexOutOfBoundsException if {@code index} is greater than or equal to
+    *         the total number of inserted interceptors contained in this advisor, or
+    *         if {@code index} is a negative value
+    */
+   void insertInterceptor(int index, Interceptor interceptor)
+      throws IndexOutOfBoundsException;
 
+   /**
+    * Inserts an interceptor stack to the beginning of the instance's interceptor
+    * chain.
+    * 
+    * @param stackName the name that identifies the interceptor stack to be inserted
+    */
+   public void insertInterceptorStack(String stackName);
+
+   /**
+    * Appends an interceptor to the end of the instance's interceptor chain.
+    * 
+    * @param interceptor the interceptor to be appended to the instance's chain
+    */
    public void appendInterceptor(Interceptor interceptor);
 
-   public void insertInterceptorStack(String stackName);
+   /**
+    * Appends an interceptor at position {@code index} of the appended instance's
+    * interceptor chain.
+    * 
+    * @param index the position where to insert {@code interceptor}. This value must
+    *        not be greater than or equal to the number of appended interceptors in
+    *        the chain.
+    * @param interceptor the interceptor to be added to the instance's chain.
+    * @throws IndexOutOfBoundsException if {@code index} is greater than or equal to
+    *         the total number of appended interceptors contained in this advisor, or
+    *         if {@code index} is a negative value
+    */
+   void appendInterceptor(int index, Interceptor interceptor)
+      throws IndexOutOfBoundsException;
 
+   /**
+    * Appends an interceptor chain to the end of the instance's interceptor chain.
+    * 
+    * @param stackName the name that identifies the interceptor stack to be appended
+    */
+   public void appendInterceptorStack(String stackName);
+
+   /**
+    * Removes an interceptor from instance's interceptor chain.
+    * 
+    * @param name name of the interceptor to be removed from the chain.
+    * @see Interceptor#getName()
+    */
+   public void removeInterceptor(String name);
+
+   /**
+    * Removes an interceptor stack from the instance's interceptor chain.
+    * 
+    * @param name the name that identifies the interceptor stack to be removed
+    */
    public void removeInterceptorStack(String name);
 
-   public void appendInterceptorStack(String stackName);
+   /**
+    * Returns the interceptor chain of the advised instance.
+    * <p>
+    * <i>For internal use only.</i>
+    * 
+    * @return the interceptor chain of the advised instance.
+    */
+   public Interceptor[] getInterceptors();
 
    /**
-    * Get the instance of an aspect.  An aspect encapsulates
-    * a set of advices.
-    *
-    * @param aspectName
-    * @return
+    * Merges the advised instance interceptor chain with {@code baseChain}.
+    * <br>
+    * The result of the merge will contain first all the inserted interceptors,
+    * then {@code baseChain}, and finally all the appended interceptors.
+    * <p>
+    * <i>For internal use only.</i>
+    * 
+    * @param  baseChain the chain to be joined with the advised instance's chain.
+    * @return a new interception chain as a result of the merge of {@code baseChain}
+    *         with the instance's chain. May return {@code baseChain} if the last one
+    *         is empty.
     */
+   public Interceptor[] getInterceptors(Interceptor[] baseChain);
+
+   /**
+    * Returns a per instance aspect object identified by {@code aspectName}.
+    * <br>
+    * Notice that the aspect objects are created by JBoss AOP, either by using an
+    * aspect factory or by using the constructor of an aspect class. 
+    * <p><i>For internal use only.</i>
+    * 
+    * @param  aspectName name of the queried aspect
+    * @return the per instance aspect named {@code aspectName}
+    */
    public Object getPerInstanceAspect(String aspectName);
 
-   void insertInterceptor(int index, Interceptor interceptor);
-
-   void appendInterceptor(int index, Interceptor interceptor);
-   
+   /**
+    * Returns a per instance aspect object defined by {@code def}.
+    * <br>
+    * Notice that the aspect objects are created by JBoss AOP, either by using an
+    * aspect factory or by using the constructor of an aspect class. 
+    * <p><i>For internal use only.</i>
+    * 
+    * @param  def definition of the queried aspect 
+    * @return the per instance aspect defined by {@code def}
+    */
    public Object getPerInstanceAspect(AspectDefinition def);
 
+   /**
+    * Returns the per instance joinpoint aspect object defined by {@code def} to be
+    * applied at {@code joipoint}.
+    * <br>
+    * Notice that the aspect objects are created by JBoss AOP, either by using an
+    * aspect factory or by using the constructor of an aspect class. 
+    * <p><i>For internal use only.</i>
+    * 
+    * @param joinpoint the joinpoint to which the aspect object will be applied.
+    * @param  def      definition of the queried aspect 
+    * @return the per instance joinpoint aspect defined by {@code def} to be applied
+    *             at {@code joinpoint}
+    */
    public Object getPerInstanceJoinpointAspect(Joinpoint joinpoint, AspectDefinition def);
-   
-   public Domain getDomain();
-   
-   public Object getInstance();
-}
+}
\ No newline at end of file

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/SecurityActions.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/SecurityActions.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/SecurityActions.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -184,4 +184,41 @@
          return GetDeclaredConstructorsAction.PRIVILEGED.getDeclaredConstructors(clazz);
       }
    }
+
+   
+   interface GetClassLoaderAction 
+   {
+      ClassLoader getClassLoader(Class clazz);
+      
+      GetClassLoaderAction NON_PRIVILEGED = new GetClassLoaderAction() {
+
+         public ClassLoader getClassLoader(Class clazz)
+         {
+            return clazz.getClassLoader();
+         }};
+
+     GetClassLoaderAction PRIVILEGED = new GetClassLoaderAction() {
+
+         public ClassLoader getClassLoader(final Class clazz)
+         {
+            return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+
+               public ClassLoader run()
+               {
+                  return clazz.getClassLoader();
+               }});
+         }};
+   }
+   
+   static ClassLoader getClassLoader(Class clazz)
+   {
+      if (System.getSecurityManager() == null)
+      {
+         return GetClassLoaderAction.NON_PRIVILEGED.getClassLoader(clazz);
+      }
+      else
+      {
+         return GetClassLoaderAction.PRIVILEGED.getClassLoader(clazz);
+      }
+   }
 }

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/SuperClassesFirstWeavingStrategy.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/SuperClassesFirstWeavingStrategy.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/SuperClassesFirstWeavingStrategy.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -46,97 +46,90 @@
    private static final Logger logger = AOPLogger.getLogger(SuperClassesFirstWeavingStrategy.class);
    
    private boolean verbose = AspectManager.verbose;
-	public static final String AOP_PACKAGE = Advised.class.getPackage().getName();
+   public static final String AOP_PACKAGE = Advised.class.getPackage().getName();
 
    public byte[] translate(AspectManager manager, String className, ClassLoader loader, byte[] classfileBuffer) throws Exception
-	{
-		if (isReEntry())
-		{
-			return null;
-		}
-		setReEntry();
-		manager.transformationStarted = true;
-		try
-		{
-			if (manager.isNonAdvisableClassName(className))
-			{
-				return null;
-			}
+   {
+      if (isReEntry())
+      {
+         return null;
+      }
+      setReEntry();
+      manager.transformationStarted = true;
+      try
+      {
+         if (manager.isNonAdvisableClassName(className))
+         {
+            return null;
+         }
 
-			AOPClassPool pool = (AOPClassPool) manager.registerClassLoader(loader);
+         AOPClassPool pool = (AOPClassPool) manager.registerClassLoader(loader);
 
-			CtClassTransformationInfo info = obtainCtClassInfo(pool, className, classfileBuffer);
-			
-//			if (className.startsWith("org.jboss.test.aop.scopedextender.")) System.out.println("********** Weaving " + className + " " + loader);
-			
-			CtClass clazz = instrumentClass(manager, pool, info, true);
-			if (clazz != null)
-			{
-				pool.lockInCache(info.getClazz());
+         CtClass clazz = obtainCtClassInfo(pool, className, classfileBuffer);
+         
+         CtClass woven = instrumentClass(manager, pool, clazz, true);
+         if (woven != null)
+         {
+            pool.lockInCache(woven);
             if (AspectManager.debugClasses)
             {
-               SecurityActions.debugWriteFile(info.getClazz());
+               SecurityActions.debugWriteFile(clazz);
             }
-				byte[] rtn = info.getClazz().toBytecode();
-				if (AspectManager.getPrune()) info.getClazz().prune();
-				return rtn;
-			}
-			else
-			{
-				pool.soften(info.getClazz());
-			}
-			return null;
-		}
-		catch (Exception ex)
-		{
-			if (!(ex instanceof NotFoundException))
-			{
-				if (verbose)
-					ex.printStackTrace();
-				else
-					System.err.println("[error] " + ex.getMessage() +
+            byte[] rtn = woven.toBytecode();
+            if (AspectManager.getPrune()) woven.prune();
+            return rtn;
+         }
+         else
+         {
+            pool.soften(clazz);
+         }
+         return null;
+      }
+      catch (Exception ex)
+      {
+         if (!(ex instanceof NotFoundException))
+         {
+            if (verbose)
+               ex.printStackTrace();
+            else
+               System.err.println("[error] " + ex.getMessage() +
                                        ".. Do verbose mode if you want full stack trace.");
-			}
-			throw ex;
-		}
-		finally
-		{
-			clearReEntry();
-		}
-	}
+         }
+         throw ex;
+      }
+      finally
+      {
+         clearReEntry();
+      }
+   }
 
-	private CtClassTransformationInfo obtainCtClassInfo(AOPClassPool pool, String className, byte[] classfileBuffer) throws NotFoundException
-	{
-		try
-		{
-			return new CtClassTransformationInfo(pool.getLocally(className), className);
-		}
-		catch (NotFoundException e)
-		{
-			// todo Bill Burke: this scares the shit out of me, but it must be done
-			// I think it will screw up hotdeployment at some time.  Then again, maybe not ;)
-			ByteArrayClassPath cp = new ByteArrayClassPath(className, classfileBuffer);
-			pool.insertClassPath(cp);
-			return new CtClassTransformationInfo(pool.getLocally(className), className);
-		}
+   private CtClass obtainCtClassInfo(AOPClassPool pool, String className, byte[] classfileBuffer) throws NotFoundException
+   {
+      try
+      {
+         return pool.getLocally(className);
+      }
+      catch (NotFoundException e)
+      {
+         // todo Bill Burke: this scares the shit out of me, but it must be done
+         // I think it will screw up hotdeployment at some time.  Then again, maybe not ;)
+         ByteArrayClassPath cp = new ByteArrayClassPath(className, classfileBuffer);
+         pool.insertClassPath(cp);
+         return pool.getLocally(className);
+      }
       catch(Error e)
       {
          return null;
       }
-	}
+   }
 
-	private CtClass instrumentClass(AspectManager manager, AOPClassPool pool, CtClassTransformationInfo info, boolean isLoadedClass) throws NotFoundException, Exception
-	{
-		try
-		{
-			CtClass superClass = info.getClazz().getSuperclass();
-			if (superClass != null && !Instrumentor.implementsAdvised(info.getClazz()))
-			{
-//			   String DEBUGNAME = info.getClazz().getName();
-//	         if (DEBUGNAME.startsWith("org.jboss.test.aop.scopedextender.")) System.out.println("---- Instrument " + DEBUGNAME + " " + pool);
-//
-				CtClassTransformationInfo superInfo = new CtClassTransformationInfo(superClass, superClass.getName());
-
+   private CtClass instrumentClass(AspectManager manager, AOPClassPool pool, CtClass clazz, boolean isLoadedClass) throws NotFoundException, Exception
+   {
+      try
+      {
+         CtClass superClass = clazz.getSuperclass();
+         if (superClass != null && !Instrumentor.implementsAdvised(clazz))
+         {
             ClassPool superPool = superClass.getClassPool();
             if (superPool instanceof AOPClassPool)
             {
@@ -146,135 +139,96 @@
                   //We are in a scoped classloader and the superclass is not
                   aspectManager = AspectManager.instance(superPool.getClassLoader());
                }
-               instrumentClass(aspectManager, (AOPClassPool)superPool, superInfo, false);
+               instrumentClass(aspectManager, (AOPClassPool)superPool, superClass, false);
             }
-			}
+         }
 
-			if (manager.isNonAdvisableClassName(info.getClassName()))
-			{
-				return null;
-			}
+         if (manager.isNonAdvisableClassName(clazz.getName()))
+         {
+            return null;
+         }
 
-			if (info.getClass().isArray())
-			{
-				if (verbose && logger.isDebugEnabled()) logger.debug("cannot compile, isArray: " + info.getClassName());
-				pool.flushClass(info.getClassName());
-				return null;
-			}
-			if (info.getClazz().isInterface())
-			{
-				if (verbose && logger.isDebugEnabled()) logger.debug("cannot compile, isInterface: " + info.getClassName());
-				//pool.flushClass(info.getClassName());
-				info.getClazz().prune();
-				return null;
-			}
-			if (info.getClazz().isFrozen())
-			{
-				if(isAdvised(pool, info.getClazz()))
-					return null;
-				if (verbose && logger.isDebugEnabled()) logger.debug("warning, isFrozen: " + info.getClassName() + " " + info.getClazz().getClassPool());
-				if (!isLoadedClass)
-				{
-					info = obtainCtClassInfo(pool, info.getClassName(), null);
-				}
-				else
-					return null;
-				//info.getClazz().defrost();
-			}
+         if (clazz.isArray())
+         {
+            if (verbose && logger.isDebugEnabled()) logger.debug("cannot compile, isArray: " + clazz.getName());
+            pool.flushClass(clazz.getName());
+            return null;
+         }
+         if (clazz.isInterface())
+         {
+            if (verbose && logger.isDebugEnabled()) logger.debug("cannot compile, isInterface: " + clazz.getName());
+            //pool.flushClass(info.getClassName());
+            clazz.prune();
+            return null;
+         }
+         if (clazz.isFrozen())
+         {
+            if(isAdvised(pool, clazz))
+               return null;
+            if (verbose && logger.isDebugEnabled()) logger.debug("warning, isFrozen: " + clazz.getName() + " " + clazz.getClassPool());
+            if (!isLoadedClass)
+            {
+               //What's the point of this?
+               clazz = obtainCtClassInfo(pool, clazz.getName(), null);
+            }
+            else
+               return null;
+            //info.getClazz().defrost();
+         }
 
-         boolean transformed = info.getClazz().isModified();
+         boolean transformed = clazz.isModified();
          if (!transformed)
          {
             ClassAdvisor advisor =
-                   AdvisorFactory.getClassAdvisor(info.getClazz(), manager);
-				Instrumentor instrumentor = InstrumentorFactory.getInstrumentor(
-				      pool,
+                   AdvisorFactory.getClassAdvisor(clazz, manager);
+            Instrumentor instrumentor = InstrumentorFactory.getInstrumentor(
+                  pool,
                   manager,
                   manager.dynamicStrategy.getJoinpointClassifier(),
-                  manager.dynamicStrategy.getDynamicTransformationObserver(info.getClazz()));
+                  manager.dynamicStrategy.getDynamicTransformationObserver(clazz));
 
-				if (!Instrumentor.isTransformable(info.getClazz()))
-				{
-					if (verbose && logger.isDebugEnabled()) logger.debug("cannot compile, implements Untransformable: " + info.getClassName());
-					//Flushing the generated invocation classes breaks things further down the line
-					//pool.flushClass(info.getClassName());
-					return null;
-				}
+            if (!Instrumentor.isTransformable(clazz))
+            {
+               if (verbose && logger.isDebugEnabled()) logger.debug("cannot compile, implements Untransformable: " + clazz.getName());
+               //Flushing the generated invocation classes breaks things further down the line
+               //pool.flushClass(info.getClassName());
+               return null;
+            }
 
-            manager.attachMetaData(advisor, info.getClazz(), true);
-            manager.applyInterfaceIntroductions(advisor, info.getClazz());
-				transformed = instrumentor.transform(info.getClazz(), advisor);
+            manager.attachMetaData(advisor, clazz, true);
+            manager.applyInterfaceIntroductions(advisor, clazz);
+            transformed = instrumentor.transform(clazz, advisor);
          }
-			if (transformed)
-			{
-				if (!isLoadedClass )
-				{
-					info.setTransformed(transformed);
-				}
-				return info.getClazz();
-			}
-			return null;
-		}
-		catch(Exception e)
-		{
-			throw new RuntimeException("Error converting class ", e);
-		}
-		finally
-		{
-		}
-	}
+         if (transformed)
+         {
+            return clazz;
+         }
+         
+         if (isLoadedClass)
+         {
+            pool.setClassLoadedButNotWoven(clazz.getName());
+         }
+         
+         return null;
+      }
+      catch(Exception e)
+      {
+         throw new RuntimeException("Error converting class ", e);
+      }
+      finally
+      {
+      }
+   }
 
-	public boolean isAdvised(ClassPool pool, CtClass clazz) throws NotFoundException
-	{
-	   CtClass[] interfaces = clazz.getInterfaces();
-	   CtClass advised = pool.get(AOP_PACKAGE + ".Advised");
-	   for (int i = 0; i < interfaces.length; i++)
-	   {
-	      if (interfaces[i].equals(advised)) return true;
-	      if (interfaces[i].getName().equals(AOP_PACKAGE + ".Advised")) return true;
-	   }
-	   return false;
-	}
-
-
-	private class CtClassTransformationInfo
-	{
-		boolean transformed;
-		CtClass clazz;
-		String className;
-		private CtClassTransformationInfo(CtClass clazz, String className)
-		{
-			this.clazz = clazz;
-			this.className = className;
-		}
-
-		private CtClassTransformationInfo(CtClass clazz, String className, boolean transformed)
-		{
-			this.clazz = clazz;
-			this.className = className;
-			this.transformed = transformed;
-		}
-
-		private CtClass getClazz()
-		{
-			return clazz;
-		}
-
-		private boolean isTransformed()
-		{
-			return transformed;
-		}
-
-		private void setTransformed(boolean transformed)
-		{
-			this.transformed = transformed;
-		}
-
-		private String getClassName()
-		{
-			return className;
-		}
-	}
-
-
+   public boolean isAdvised(ClassPool pool, CtClass clazz) throws NotFoundException
+   {
+      CtClass[] interfaces = clazz.getInterfaces();
+      CtClass advised = pool.get(AOP_PACKAGE + ".Advised");
+      for (int i = 0; i < interfaces.length; i++)
+      {
+         if (interfaces[i].equals(advised)) return true;
+         if (interfaces[i].getName().equals(AOP_PACKAGE + ".Advised")) return true;
+      }
+      return false;
+   }
 }

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/advice/AdviceBinding.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/advice/AdviceBinding.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/advice/AdviceBinding.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -1,24 +1,24 @@
 /*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., 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.
-  */
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.advice;
 
 import java.io.StringReader;
@@ -31,6 +31,7 @@
 
 import org.jboss.aop.Advisor;
 import org.jboss.aop.AspectManager;
+import org.jboss.aop.Domain;
 import org.jboss.aop.pointcut.Pointcut;
 import org.jboss.aop.pointcut.PointcutExpression;
 import org.jboss.aop.pointcut.ast.ASTCFlowExpression;
@@ -40,10 +41,12 @@
 import org.jboss.logging.Logger;
 
 /**
- * Comment
+ * Binds a pointcut expression to one ore more advices/interceptors.
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  * @version $Revision$
+ * @see AspectManager#addBinding(AdviceBinding)
+ * @see AspectManager#removeBinding(String)
  */
 public class AdviceBinding
 {
@@ -51,17 +54,56 @@
    
    private static volatile long counter = 0;
 
+   /**
+    * Name that identifies this binding in its {@link Domain domain}.
+    */
    protected String name;
+   
+   /**
+    * Identifies when the advices/interceptors contained in this binding should
+    * be invoked.
+    */
    protected Pointcut pointcut;
+   
+   /**
+    * A control flow restriction (in its AST form). Can be {@code null}.
+    */
    protected ASTCFlowExpression cflow;
+   
+   /**
+    * A control flow restriction (in its string form). Can be {@code null}
+    */
    protected String cflowString;
 
    // not list because of redundancy caused by successive calls of ClassAdvisor.rebuildInterceptors
-   protected Map advisors = new WeakHashMap();
+   /**
+    * Contains all the client advisors, mapped to a boolean value.
+    */
+   protected Map<Advisor, Boolean> advisors = new WeakHashMap<Advisor, Boolean>();
+   
+   /**
+    * The factories responsible for creating the bound interceptor instances.
+    */
    protected InterceptorFactory[] interceptorFactories = new InterceptorFactory[0];
 
+   
    public AdviceBinding() {}
 
+   /**
+    * Constructor to be used internally.
+    * 
+    * @param name             identifies this definition in its {@link Domain domain}
+    * @param p                pointcut expression. Only the joinpoints that satisfy
+    *                         this expression will be intercepted by the bound
+    *                         interceptors.
+    * @param cflow            a control flow condition in the form of an {@code AST}
+    *                         parser
+    * @param cflowString      a control flow expression
+    * @param factories        creates the objects that will perform interception
+    *                         on the matched joinpoints
+    * @throws ParseException  when {@code cflowString} is not {@code null} and
+    *                         contains a syntax error
+    */
    public AdviceBinding(String name, Pointcut p, ASTCFlowExpression cflow, String cflowString, InterceptorFactory[] factories) throws ParseException
    {
       this.name = name;
@@ -73,11 +115,27 @@
    }
 
    /**
-    * This constructor is used for creation of AdviceBinding programmatically
-    *
-    * @param pointcutExpression
-    * @param cflow
-    * @throws ParseException
+    * This constructor is used for creation of advice bindings programmatically on
+    * dynamic AOP operations.
+    * <p>
+    * The {@link #name name} of the advice will be generated automatically.
+    * <p>
+    * Bound interceptors will be invoked only on the joinpoints that are matched
+    * by {@code pointcutExpression}, and that satisfy {@code cflow} if it is not
+    * {@code null}.
+    * 
+    * @param pointcutExpression pointcut expression. Only the joinpoints that satisfy
+    *                           this expression will be intercepted by the bound
+    *                           interceptors. 
+    * @param cflow              a control flow expression. Can be {@code null} if no
+    *                           such condition is necessary. Notice that using
+    *                           control flow conditions requires runtime checks and
+    *                           may impact your system performance. Always prefer to
+    *                           use pointcut expressions of the form {@code call(...)
+    *                           AND within(...)} or {@code call(...) AND
+    *                           withincode(...)} instead, whenever applicable.
+    * @throws ParseException    when {@code cflow} is not {@code null} and contains a
+    *                           syntax error
     */
    public AdviceBinding(String pointcutExpression, String cflow) throws ParseException
    {
@@ -85,11 +143,27 @@
    }
 
    /**
-    * This constructor is used for creation of AdviceBinding programmatically
+    * This constructor is used for creation of advice bindings programmatically on
+    * dynamic AOP operations. Call this constructor when you want to define the
+    * binding's name.
+    * <p>
+    * Bound interceptors will be invoked only on the joinpoints that are matched
+    * by {@code pointcutExpression}, and that satisfy {@code cflow} if it is not
+    * {@code null}.
     *
-    * @param pointcutExpression
-    * @param cflow
-    * @throws ParseException
+    * @param name               identifies this binding in its {@link Domain domain}.
+    * @param pointcutExpression pointcut expression. Only the joinpoints that satisfy
+    *                           this expression can be intercepted by the bound
+    *                           interceptors. 
+    * @param cflow              a control flow expression. Can be {@code null} if no
+    *                           such condition is necessary. Notice that using
+    *                           control flow conditions requires runtime checks and
+    *                           may impact your system performance. Always prefer to
+    *                           use pointcut expressions of the form {@code call(...)
+    *                           AND within(...)} or {@code call(...) AND
+    *                           withincode(...)} instead, whenever applicable.
+    * @throws ParseException    when {@code cflow} is not {@code null} and contains a
+    *                           syntax error
     */
    public AdviceBinding(String name, String pointcutExpression, String cflow) throws ParseException
    {
@@ -99,6 +173,20 @@
       interceptorFactories = new InterceptorFactory[0];
    }
 
+   /**
+    * Defines a control-flow restriction to this binding.
+    * <br>
+    * Bound interceptors will not be invoked when this restriction is not satisfied.
+    * <br>
+    * Notice that using control flow conditions requires runtime checks and may
+    * impact your system performance. Always prefer to use pointcut expressions of
+    * the form {@code call(...) AND within(...)} or {@code call(...) AND
+    * withincode(...)} instead, whenever applicable.
+    * 
+    * @param cflow              a control flow expression.
+    * @throws ParseException    when {@code cflow} is not {@code null} and contains a
+    *                           syntax error
+    */
    public void setCFlowExpression(String cflow)
            throws ParseException
    {
@@ -109,48 +197,136 @@
       }
    }
 
+   /**
+    * Defines the pointcut expression to be used by this binding.
+    * <br>
+    * Bound interceptors will be invoked only on the joinpoints that are matched
+    * by this expression, and that satisfy the {@code cflow} condition if there is
+    * one. 
+    * 
+    * @param pointcutExpression pointcut expression. Only the joinpoints that satisfy
+    *                           this expression can be intercepted by the bound
+    *                           interceptors.
+    * @throws ParseException    when {@code cflow} is not {@code null} and contains a
+    *                           syntax error
+    */
    public void setPointcutExpression(String pointcutExpression)
            throws ParseException
    {
       pointcut = new PointcutExpression(Long.toString(System.currentTimeMillis()) + ":" + Long.toString(counter++), pointcutExpression);
    }
 
+   /**
+    * Adds an interceptor to the chain.
+    * 
+    * @param factory creates the interceptor instances that will be invoked during
+    *                interception
+    */
    public void addInterceptorFactory(InterceptorFactory factory)
    {
-      List list = Arrays.asList(interceptorFactories);
-      list = new ArrayList(list);
+      List<InterceptorFactory> list = Arrays.asList(interceptorFactories);
+      list = new ArrayList<InterceptorFactory>(list);
       list.add(factory);
-      interceptorFactories = (InterceptorFactory[]) list.toArray(new InterceptorFactory[list.size()]);
+      interceptorFactories = list.toArray(new InterceptorFactory[list.size()]);
    }
 
 
    /**
-    * Add an interceptor to chain.  This is an actual class
-    * that implements Interceptor.  A GenericInterceptorFactory will
-    * be created to wrap the class.
+    * Adds an interceptor to the chain.  
     *
-    * @param clazz
+    * @param clazz the actual class that implements {@link Interceptor}. This class
+    *              must provide a default constructor so it can be created.
+    *              A {@code GenericInterceptorFactory} will be used to create the
+    *              interceptor instances.
+    * @see GenericInterceptorFactory
     */
    public void addInterceptor(Class clazz)
    {
       addInterceptorFactory(new GenericInterceptorFactory(clazz));
    }
 
+   /**
+    * Returns the name of this binding. This name is unique inside the
+    * {@link Domain domain}.
+    * 
+    * @return name the name that identifies this binding in its {@link Domain domain}
+    */
    public String getName()
    {
       return name;
    }
 
+   /**
+    * Returns the interceptor factory chain.
+    * <p><i>For internal use only.</i>
+    * 
+    * @return an array containing the interceptor factory chain. This chain will
+    *         be used to create an equivalent chain (same order) of interceptor
+    *         instances. The generated interceptor chain is the one that will
+    *         be used on interception. This chain must not be edited this chain.
+    * @see #addInterceptor(Class)
+    * @see #addInterceptorFactory(InterceptorFactory)
+    */
    public InterceptorFactory[] getInterceptorFactories()
    {
       return interceptorFactories;
    }
 
+   /**
+    * Defines the name of this binding. This name must be unique inside the
+    * {@link Domain domain}.
+    * 
+    * @param name the name that identifies this binding in its {@link Domain domain}
+    */
    public void setName(String name)
    {
       this.name = name;
    }
 
+   /**
+    * Returns the pointcut that determines when the bound interceptor chain should
+    * be invoked.
+    * <p><i>For internal use only.</i>
+    * 
+    * @return the pointcut object
+    */
+   public Pointcut getPointcut()
+   {
+      return pointcut;
+   }
+
+   /**
+    * Returns the cflow condition in the form an {@code AST} parser.
+    * <p><i>For internal use only.</i>
+    * 
+    * @return the cflow condition that must be satisfied by joinpoints in order for
+    *         the bound interceptors to be invoked
+    */
+   public ASTCFlowExpression getCFlow()
+   {
+      return cflow;
+   }
+
+   /**
+    * Returns the cflow condition.
+    * 
+    * @return the cflow condition expression that must be satisfied by joinpoints in
+    *         order for the bound interceptors to be invoked
+    */
+   public String getCFlowString()
+   {
+      return cflowString;
+   }
+
+   
+   /**
+    * Adds an advisor as a client of this binding.
+    * <p>
+    * <i>For internal use only.</i>
+    * 
+    * @param advisor manages one or more joinpoints that are matched by
+    *                the bound {@link #pointcut}.
+    */
    public void addAdvisor(Advisor advisor)
    {
       if (AspectManager.verbose && logger.isDebugEnabled()) logger.debug("added advisor: " + advisor.getName() + " from binding: " + name);
@@ -163,14 +339,27 @@
       
    }
 
+   /**
+    * Indicates whether there are any advisors using this binding for interception.
+    * 
+    * @return {@code true} if and only if there are one or more advisors that use
+    *         this binding for interception
+    */
    public boolean hasAdvisors()
    {
       return advisors.size() > 0;
    }
 
-   public ArrayList getAdvisors()
+   /**
+    * Returns the list of the client advisors.
+    * <p>
+    * <i>For internal use only.</i>
+    * 
+    * @return the list of the advisors that use this binding for interception
+    */
+   public ArrayList<Advisor> getAdvisors()
    {
-      ArrayList list = new ArrayList(advisors.size());
+      ArrayList<Advisor> list = new ArrayList<Advisor>(advisors.size());
       synchronized (advisors)
       {
          list.addAll(advisors.keySet());
@@ -178,6 +367,11 @@
       return list;
    }
 
+   /**
+    * Clears the list of the client advisors.
+    * <p>
+    * <i>For internal use only.</i>
+    */
    public void clearAdvisors()
    {
       synchronized (advisors)
@@ -194,6 +388,13 @@
       }
    }
 
+   /**
+    * Compares this binding with {@code obj} for equality.
+    * 
+    * @param obj the object to be compared with this binding for equality
+    * @return {@code true} if and only if {@code obj} is a binding with a name that
+    *         is equal to the name of this binding.
+    */
    public boolean equals(Object obj)
    {
       if (obj == this) return true;
@@ -201,23 +402,9 @@
       return ((AdviceBinding) obj).getName().equals(name);
    }
 
+   
    public int hashCode()
    {
       return name.hashCode();
    }
-
-   public Pointcut getPointcut()
-   {
-      return pointcut;
-   }
-
-   public ASTCFlowExpression getCFlow()
-   {
-      return cflow;
-   }
-
-   public String getCFlowString()
-   {
-      return cflowString;
-   }
 }

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/advice/AdviceType.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/advice/AdviceType.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/advice/AdviceType.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -26,17 +26,42 @@
 /**
  * Indicates whether the type of an advice is <i>before</i>, <i>around</i>,
  * <i>after</i>, <i>throwing</i> or <i>finally</i>.
- * 
+ * <br>
  * Notice that interceptors are a special type of <i>around</i> advices.
+ * <p><i>For internal use only.</i>
  * 
  * @author  <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
  */
 public enum AdviceType
 {
+   /**
+    * Advice will be invoked before the joinpoint execution.
+    */
    BEFORE("before", AdviceMethodFactory.BEFORE, true, "before"),
+   
+   /**
+    * Advice will be invoked around the joinpoint execution, and as such is
+    * responsible for invoking the next advice in the chain and returning the
+    * joinpoint result value.
+    */
    AROUND("around", AdviceMethodFactory.AROUND, false, "around"),
+   
+   /**
+    * Advice will be invoked after the joinpoint execution, only if it returns
+    * normally.
+    */
    AFTER("after", AdviceMethodFactory.AFTER, false, "after"),
+   
+   /**
+    * Advice will be invoked after the joinpoint execution, only if it throws an
+    * exception.
+    */
    THROWING("throwing", AdviceMethodFactory.THROWING, false, "after-throwing"),
+   
+   /**
+    * Advice will be invoked after the joinpoint execution, regardless of how it
+    * returns.
+    */
    FINALLY("finally", AdviceMethodFactory.FINALLY, false, "finally");
    
    private String name;
@@ -67,7 +92,7 @@
    
    /**
     * Returns an accessor string for this type.
-    * 
+    * <br>
     * This accessor is built by concatenating <code>"get"</code> with the
     * the {@link #getName() description} starting with an upper case.
     * 
@@ -91,7 +116,7 @@
    
    /**
     * Indicates if the use of this advice type is restrictive to the generated
-    * advisor mode, or if can be used on all instrumentation modes.
+    * advisor mode, or if it can be used on all instrumentation modes.
     * 
     * @return <code>true</code> only if this advice type must be used on generated
     *         advisor mode.

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/advice/AspectDefinition.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/advice/AspectDefinition.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/advice/AspectDefinition.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -1,24 +1,24 @@
 /*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., 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.
-  */
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.advice;
 
 import java.util.Iterator;
@@ -26,31 +26,62 @@
 import java.util.WeakHashMap;
 
 import org.jboss.aop.Advisor;
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.Domain;
 import org.jboss.aop.GeneratedClassAdvisor;
 
 /**
- * Contains definition of aspect or interceptor
- * Scope defaults to PER_VM if it is null.
- *
+ * Definition of an aspect or interceptor.
+ * <br>
+ * This class is used by JBoss AOP to manage all configured informations regarding
+ * aspects and interceptors, and can be used to define new aspects and interceptors
+ * dynamically.
+ * 
+ * 
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  * @version $Revision$
+ * @see AspectManager#addAspectDefinition(AspectDefinition)
  */
 public class AspectDefinition
 {
+   /**
+    * Name of the aspect. Identifies this aspect in its {@link Domain domain}.
+    */
    protected String name;
+   
+   /**
+    * Scope of the aspect, defines how many times it must be created during
+    * execution.
+    */
    protected Scope scope = Scope.PER_VM;
+   
+   /**
+    * Aspect's factory, responsible for creating the aspect instances.
+    */
    protected AspectFactory factory;
+   
+   /**
+    * Indicates whether this definition has been deployed in the
+    * {@link Domain domain}.
+    */
    protected boolean deployed = true;
 
    /**
     * @deprecated should not call this directly
     */
-   public Map advisors = new WeakHashMap();
+   public Map<Advisor, Boolean> advisors = new WeakHashMap<Advisor, Boolean>();
 
    /**
-    * @param name
-    * @param scope   defaults to PER_VM if null
-    * @param factory
+    * Creates an aspect definition.
+    * 
+    * @param name    the name of the aspect. This name is used by the domain to
+    *                identify the aspect, so it must be unique in the AOP
+    *                {@link Domain domain}.
+    * @param scope   the aspect scope, indicates how many aspects instances must
+    *                be created during execution. Defaults to PER_VM if {@code null}.
+    * @param factory factory responsible for creating the aspect instances
+    * @see AspectFactory
+    * @see GenericAspectFactory
     */
    public AspectDefinition(String name, Scope scope, AspectFactory factory)
    {
@@ -64,6 +95,11 @@
 
    public AspectDefinition() {}
 
+   /**
+    * Undeploys the aspect definition from its domain.
+    *
+    */
+   @SuppressWarnings("deprecation")
    public synchronized void undeploy()
    {
       if (advisors.size() > 0)
@@ -105,60 +141,136 @@
       }
       this.deployed = false;
    }
+   
+   /**
+    * Returns {@code true} if this aspect definition is deployed in its
+    * {@link Domain domain}.An aspect definition is considered to be deployed if it
+    * is active in the domain, and can intercept joinpoints. It is not deployed when it
+    * is inactive and won't intercept any joinpoints.
+    * 
+    * @return {@code true} if this aspect definition is active in its domain
+    */
    public boolean isDeployed()
    {
       return deployed;
    }
 
+   /**
+    * Sets the name of this aspect definition. This name must be unique inside the
+    * {@link Domain domain}.
+    * 
+    * @param name the new name of this aspect definition.
+    */
    public void setName(String name)
    {
       this.name = name;
    }
 
+   /**
+    * Sets the scope of this aspect definition. The scope defines the lifecycle
+    * of the aspect instances.
+    * 
+    * @param scope the new scope of this aspect definition.
+    */
    public void setScope(Scope scope)
    {
       this.scope = scope;
    }
 
+   /**
+    * Sets the factory of this aspect definition, responsible for providing the
+    * instances at runtime.
+    * 
+    * @param factory the new factory of this aspect definition
+    */
    public void setFactory(AspectFactory factory)
    {
       this.factory = factory;
    }
 
+   /**
+    * Returns the factory of this aspect definition, responsible for providing
+    * the instances at runtime.
+    * 
+    * @return the factory of this aspect definition
+    */
    public AspectFactory getFactory()
    {
       return factory;
    }
 
+   /**
+    * Returns the name of this aspect definition. This name is unique inside the
+    * {@link Domain domain}.
+    * 
+    * @return name the name that identifies this definition in its
+    *             {@link Domain domain}
+    */
    public String getName()
    {
       return name;
    }
 
+   /**
+    * Registers {@code advisor} as being a client of this definition. This means
+    * that {@code advisor} uses an instance of the defined aspect for interception
+    * of one or more joinpoints.
+    * <p><i>For internal use only</i>
+    * 
+    * @param advisor an advisor responsible for managing joinpoints and their
+    *                interception execution
+    */
+   @SuppressWarnings("deprecation")
+   public synchronized void registerAdvisor(Advisor advisor)
+   {
+      advisors.put(advisor, Boolean.TRUE);
+   }
+
+   /**
+    * Unregisters {@code advisor} as being a client of this definition. This means
+    * that {@code advisor} no more uses an instance of the defined aspect for
+    * interception.
+    * <p><i>For internal use only</i>
+    * 
+    * @param advisor responsible for managing a set of joinpoints and their
+    *                interception execution
+    */
+   @SuppressWarnings("deprecation")
+   public synchronized void unregisterAdvisor(Advisor advisor)
+   {
+      advisors.remove(advisor);
+   }
+   
+   /**
+    * Returns the scope of this aspect definition. The scope defines how many
+    * instances of the aspect are necessary at runtime.
+    * 
+    * @return scope the scope of this aspect definition.
+    */
    public Scope getScope()
    {
       return scope;
    }
 
+   @Override
    public int hashCode()
    {
       return name.hashCode();
    }
 
+   /**
+    * Compares this aspect definition with {@code obj} for equality. Returns
+    * {@code true} if and only if {@code obj} is an aspect definition with the same
+    * {@link #getName() name} as this one.
+    * 
+    * @param obj the obj for comparison.
+    * @return    {@code true} if {@code obj} is an aspect definition with the same
+    *            {@link #getName() name} as this one.
+    */
    public boolean equals(Object obj)
    {
       if (obj == this) return true;
       if (!(obj instanceof AspectDefinition)) return false;
       return name.equals(((AspectDefinition) obj).name);
    }
-
-   public synchronized void registerAdvisor(Advisor advisor)
-   {
-      advisors.put(advisor, Boolean.TRUE);
-   }
-
-   public synchronized void unregisterAdvisor(Advisor advisor)
-   {
-      advisors.remove(advisor);
-   }
-}
+}
\ No newline at end of file

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/advice/AspectFactory.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/advice/AspectFactory.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/advice/AspectFactory.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -26,19 +26,121 @@
 import org.jboss.aop.joinpoint.Joinpoint;
 
 /**
- * Comment
- *
+ * Creates aspect instances.
+ * <p>
+ * This interface must be implemented by all aspect factories. Declare aspect
+ * factories instead of the real aspect class when you want:
+ * <ul>
+ * <li> to perform some specific action during aspect instance creation  (like some
+ *      initialization that could not be performed by the aspect constructor,
+ *      for example);</li>
+ * <li> to create instances of different classes, according to the context where
+ *      the aspect will be invoked.</li>
+ * <li> or to do anything else that could not be done without implementing a factory;
+ * </li>
+ * </ul>
+ * <p>
+ * This interface provides different methods. However, only the one(s) correspondent
+ * to the {@link Scope} of the aspect will be called. Hence, when writing an aspect
+ * factory whose scope is known (and is not intended to change), the implemention of
+ * the other methods can be empty. However, we advise throwing a runtime exception
+ * from those methods instead of simply returning {@code null}, to alert for
+ * unpredicted scenarios in case the {@code Scope} value is not the expected.  
+ * <p>
+ * 
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  * @version $Revision$
  */
 public interface AspectFactory
 {
+   /**
+    * Creates an aspect with scope value {@link Scope#PER_VM}.
+    * 
+    * @return the single aspect instance that will be invoked for all applicable
+    *         joinpoints during  Java VM execution
+    */
    Object createPerVM();
+   
+   /**
+    * Creates an aspect with scope value {@link Scope#PER_CLASS}.
+    * 
+    * @param advisor manages all the interceptions that should occur during execution
+    *                of a specific class
+    * @return        the aspect instance that will be invoked for all applicable
+    *                joinpoints contained in the class managed by {@code advisor}
+    * @see Advisor#getClazz() 
+    */
    Object createPerClass(Advisor advisor);
+   
+   /**
+    * Creates an aspect with scope value {@link Scope#PER_INSTANCE}.
+    * 
+    * @param advisor         manages all the interceptions that should occur during
+    *                        execution of a specific class
+    * @param instanceAdvisor manages all the interceptions that should occur during
+    *                        execution of a specific instance. The instance it
+    *                        manages is an object of the class managed by
+    *                        {@code advisor}
+    * @return                the aspect instance that will be invoked for all
+    *                        applicable joinpoints contained in the instance managed
+    *                        by {@code instanceAdvisor}
+    * @see Advisor#getClazz()
+    * @see InstanceAdvisor#getInstance()
+    */
    Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor);
+   
+   /**
+    * Creates an aspect with scope value {@link Scope#PER_CLASS_JOINPOINT} or
+    * {@link Scope#PER_JOINPOINT}.
+    * <br>
+    * In case the scope value is {@code PER_CLASS_JOINPOINT}, this method will always
+    * be invoked to create the aspect instance. On the other hand, if the scope value
+    * is {@code PER_JOINPOINT}, this method is called only if the joinpoint
+    * to be intercepted is in a static context (like a static method, a static field
+    * access, or a constructor execution).
+    * 
+    * @param advisor manages all the interceptions that should occur during
+    *                execution of a specific class
+    * @param jp      the joinpoint to be intercepted by the created instance.
+    *                This joinpoint is contained in the class managed by
+    *                {@code advisor}
+    * @return        the aspect instance that will be invoked only to intercept
+    *                {@code jp}
+    * @see Advisor#getClazz()
+    * @see Joinpoint
+    */
    Object createPerJoinpoint(Advisor advisor, Joinpoint jp);
+   
+   /**
+    * Creates an aspect with scope value or {@link Scope#PER_JOINPOINT}.
+    * <br>
+    * This method is called only if the joinpoint to be intercepted is not in a
+    * static context (like a non-static method, for example).
+    * 
+    * @param advisor         manages all the interceptions that should occur
+    *                        during execution of a specific class
+    * @param instanceAdvisor manages all the interceptions that should occur during
+    *                        execution of a specific instance. The instance it
+    *                        manages is an object of the class managed by
+    *                        {@code advisor}
+    * @param jp              the joinpoint to be intercepted by the created instance.
+    *                        This joinpoint is contained in the class managed by
+    *                        {@code advisor}
+    * @return                the aspect instance that will be invoked only to
+    *                        intercept {@code jp} when it happens on the instance
+    *                        managed by {@code instanceAdvisor}
+    * @see Advisor#getClazz()
+    * @see InstanceAdvisor#getInstance()
+    * @see Joinpoint
+    */
    Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp);
 
-   /** The name of the class */
+   /**
+    * The name that identifies the aspect in its domain. Typically, the name is the
+    * name of the class.
+    * 
+    * @return the name that identifies the aspect in its domain.
+    * @see org.jboss.aop.Domain
+    */
    String getName();
-}
+}
\ No newline at end of file

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/advice/Interceptor.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/advice/Interceptor.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/advice/Interceptor.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -1,30 +1,67 @@
 /*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., 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.
-  */
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.advice;
 
+import org.jboss.aop.Domain;
 import org.jboss.aop.joinpoint.Invocation;
 
+/**
+ * Intercepts one or more joinpoints. <br>
+ * The {@code Interceptor} is a specific type of aspect, that contains only
+ * one, well defined advice, the {@code invoke} method. Because of that, an
+ * {@code Interceptor} is also referred to as an advice.
+ */
 public interface Interceptor
 {
+   /**
+    * Returns the name of this interceptor. This name is unique inside the
+    * {@link Domain domain}.
+    * 
+    * @return name the name that identifies this interceptor in its
+    *         {@link Domain domain}
+    */
    public String getName();
+   
+   /**
+    * The single advice contained in the {@code Interceptor}.
+    * <br>
+    * To call the next interceptor or advice in the chain, this method must call
+    * {@code invocation.invokeNext()} method (if there are not elements left to
+    * be called in the chain, this method invokes the joinpoint itself). Not doing
+    * so means halting the execution of the interceptor chain and, hence, avoiding
+    * the execution of the joinpoint. This should be done only when the
+    * interceptor must replace the joinpoint execution.
+    * 
+    * @param invocation represents the joinpoint to be intercepted
+    * @return           the result value. This value will be returned to the previous
+    *                   interceptor/advice as a result of
+    *                   {@link Invocation#invokeNext()}. In case this is the first
+    *                   interceptor in the chain, this value will replace the
+    *                   joinpoint return value in the basis system. 
+    * @throws Throwable may throw any exceptions declared by the joinpoint itself.
+    *                   If this exception is not declared and is not a runtime
+    *                   exception, it will be encapsulated in a
+    *                   {@link RuntimeException} before being thrown to the basis
+    *                   system.
+    */
    public Object invoke(Invocation invocation) throws Throwable;
-}
+}
\ No newline at end of file

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/advice/Scope.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/advice/Scope.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/advice/Scope.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -1,33 +1,61 @@
 /*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., 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.
-  */
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.advice;
 
 /**
- * Defines the lifecycle of an aspect or interceptor instance
+ * Defines the lifecycle of an aspect or interceptor instance.
+ * <br>
+ * When not specified, the default scope of an aspect or interceptor is
+ * {@code PER_VM}.
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  * @version $Revision$
  */
 public enum Scope
 {
-   PER_VM, PER_CLASS, PER_INSTANCE, PER_JOINPOINT, PER_CLASS_JOINPOINT
-}
+   /**
+    * A single instance of the aspect will be created to intercept any joinpoints
+    * during the Java VM execution.
+    */
+   PER_VM,
+   
+   /**
+    * An instance of the aspect will be created for each advised class.
+    */
+   PER_CLASS,
+   
+   /**
+    * An instance of the aspect will be created for each advised instance.
+    */
+   PER_INSTANCE,
+   
+   /**
+    * An instance of the aspect will be created for each advised joinpoint execution.
+    */
+   PER_JOINPOINT,
+   
+   /**
+    * An instance of the aspect will be created for each advised joinpoint. Notice
+    * that the same instance will be used for all executions of the same joinpoint.
+    */
+   PER_CLASS_JOINPOINT
+}
\ No newline at end of file

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/array/ArrayBinding.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/array/ArrayBinding.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/array/ArrayBinding.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -41,7 +41,7 @@
 
    protected InterceptorFactory[] interceptorFactories = new InterceptorFactory[0];
 
-   public ArrayBinding(String name, InterceptorFactory[] factories, Type type) throws ParseException
+   public ArrayBinding(String name, InterceptorFactory[] factories, Type type)
    {
       this.name = name;
       interceptorFactories = factories;

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/classpool/AOPClassPool.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/classpool/AOPClassPool.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/classpool/AOPClassPool.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -44,6 +44,9 @@
    protected ConcurrentHashMap<String, String> generatedClasses = new ConcurrentHashMap<String, String>();
    
    protected ConcurrentHashMap<String, Boolean> localResources = new ConcurrentHashMap<String, Boolean>();
+   
+   /** Classnames of classes that have been loaded, but were not woven */
+   protected ConcurrentHashMap<String, Boolean> loadedButNotWovenClasses = new ConcurrentHashMap<String, Boolean>();
 
    static 
    {
@@ -180,6 +183,15 @@
       return clazz;
    }
 
+   public void setClassLoadedButNotWoven(String classname)
+   {
+      loadedButNotWovenClasses.put(classname, Boolean.TRUE);
+   }
+   
+   public boolean isClassLoadedButNotWoven(String classname)
+   {
+      return loadedButNotWovenClasses.get(classname) == Boolean.TRUE;
+   }
 
    public static AOPClassPool createAOPClassPool(ClassLoader cl, ClassPool src, ScopedClassPoolRepository repository)
    {

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/instrument/GeneratedAdvisorInstrumentor.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/instrument/GeneratedAdvisorInstrumentor.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/instrument/GeneratedAdvisorInstrumentor.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -42,6 +42,7 @@
 import org.jboss.aop.MethodByConInfo;
 import org.jboss.aop.MethodByMethodInfo;
 import org.jboss.aop.MethodInfo;
+import org.jboss.aop.WeavingStrategySupport;
 import org.jboss.aop.classpool.AOPClassPool;
 import org.jboss.aop.instrument.MethodExecutionTransformer.MethodTransformation;
 
@@ -631,16 +632,47 @@
          "   } " +
          "   return " + INSTANCE_ADVISOR +";" +
          "}";
-      CtMethod getInstanceAdvisor = CtNewMethod.make(
-            forName("org.jboss.aop.InstanceAdvisor"),
-            "_getInstanceAdvisor",
-            new CtClass[0],
-            new CtClass[0],
-            body,
-            clazz);
-      clazz.addMethod(getInstanceAdvisor);
+      try
+      {
+         CtMethod getInstanceAdvisor = CtNewMethod.make(
+               forName("org.jboss.aop.InstanceAdvisor"),
+               "_getInstanceAdvisor",
+               new CtClass[0],
+               new CtClass[0],
+               body,
+               clazz);
+         clazz.addMethod(getInstanceAdvisor);
+      }
+      catch (Exception e)
+      {
+         // AutoGenerated
+         throw new RuntimeException(e);
+      }
    }
 
+   @Override
+   protected boolean isBaseClass(CtClass clazz) throws NotFoundException
+   {
+      CtClass supa = clazz.getSuperclass(); 
+      if (supa == null || supa.getName().equals("java.lang.Object"))
+      {
+         return true;
+      }
+
+      //The superClass may 
+      // 1) already have been loaded at some stage where there were no binidings,
+      // 2) later some bindings were added which would affect the superclass
+      // 3) a new child class is loaded and since the SuperClassesWeavingStrategy will attempt to 
+      // weave not modified superclasses, the CtClass will contain the right baseclass stuff, although
+      // the already loaded class does not.
+      if (classPool.isClassLoadedButNotWoven(supa.getName()))
+      {
+         return true;
+      }
+
+      return !isAdvised(supa);
+   }
+   
    public static String updatedAdvicesName(String infoName)
    {
       return infoName + "_updated";

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/instrument/Instrumentor.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/instrument/Instrumentor.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/instrument/Instrumentor.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -72,7 +72,7 @@
  * </pre>
  *
  * You can control which instrumentor to use by passing in the jboss.aop.instrumentor
- * system property. 
+ * system property.
  *
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
@@ -84,7 +84,7 @@
 public abstract class Instrumentor
 {
    private static final Logger logger = AOPLogger.getLogger(Instrumentor.class);
-   
+
    /**
     * Package of AOP classes.
     */
@@ -116,18 +116,18 @@
    ConstructorExecutionTransformer constructorExecutionTransformer;
    ConstructionTransformer constructionTransformer;
    FieldAccessTransformer fieldAccessTransformer;
-   CallerTransformer callerTransformer;  
+   CallerTransformer callerTransformer;
    DynamicTransformationObserver dynamicTransformationObserver;
-   
+
    /**
     * Constructs new instrumentor.
     * @param joinpointClassifier algorithm of joinpoint classification to be used.
     * @param observer need be notified of every joinpoint wrapping caused only
     * by pointcuts dynamicaly added.
     */
-   protected Instrumentor(AOPClassPool pool, 
-         AspectManager manager, 
-         JoinpointClassifier joinpointClassifier, 
+   protected Instrumentor(AOPClassPool pool,
+         AspectManager manager,
+         JoinpointClassifier joinpointClassifier,
          DynamicTransformationObserver observer)
    {
       this.classPool = pool;
@@ -138,17 +138,17 @@
       intitialiseTransformers();
    }
 
-   protected Instrumentor(AspectManager manager, 
+   protected Instrumentor(AspectManager manager,
          JoinpointClassifier joinpointClassifier)
    {
-      this(null, 
-            manager, 
-            joinpointClassifier, 
+      this(null,
+            manager,
+            joinpointClassifier,
             null);
    }
-   
+
    protected abstract void intitialiseTransformers();
-   
+
    public ClassPool getClassPool()
    {
       return classPool;
@@ -170,7 +170,7 @@
       }
       return false;
    }
-   
+
    public static boolean implementsAdvised(CtClass clazz) throws NotFoundException
    {
       CtClass[] interfaces = clazz.getInterfaces();
@@ -267,13 +267,13 @@
          }
          if (!correct)
          {
-            throw new RuntimeException("Could not find a method named '" + 
+            throw new RuntimeException("Could not find a method named '" +
                   pointcut.getConstructorMethod() + "' on class " +
-                  pointcut.getConstructorClass() + " that receives " + 
+                  pointcut.getConstructorClass() + " that receives " +
                   clazz.getName() + " or one of its superclasses as parameter.");
          }
       }
-      
+
       String initializer = null;
       if (mixin.getConstruction() == null)
       {
@@ -286,8 +286,8 @@
       }
       else
       {
-         initializer = mixin.getConstruction(); 
-      } 
+         initializer = mixin.getConstruction();
+      }
       CtClass type = forName(mixinClass.getName());
       CtField field = new CtField(type, mixinFieldName(mixinClass), clazz);
       int modifiers = Modifier.PRIVATE;
@@ -309,13 +309,13 @@
             Map.Entry entry = (Map.Entry) entries.next();
             Long hash = (Long) entry.getKey();
             CtMethod method = (CtMethod) entry.getValue();
-            CtMethod baseMethod = (CtMethod)baseMethods.get(hash); 
+            CtMethod baseMethod = (CtMethod)baseMethods.get(hash);
             if (baseMethod != null && !addedMethods.contains(hash))
             {
                String msg = "Mixin " + mixinClass.getName() +
                         " of pointcut " + pointcut.getName() +
                         " is trying to apply an already existing method" + method.getName() + " for class " + clazz.getName();
-               
+
                if (baseMethod.getDeclaringClass().equals(clazz))
                {
                   throw new RuntimeException(msg);
@@ -371,7 +371,7 @@
            throws Exception
    {
       ArrayList<InterfaceIntroduction> pointcuts = advisor.getInterfaceIntroductions();
-      
+
       if (pointcuts.size() == 0) return;
       HashMap baseMethods = JavassistMethodHashing.getDeclaredMethodMap(clazz);
       Iterator<InterfaceIntroduction> it = pointcuts.iterator();
@@ -586,7 +586,7 @@
    {
       return callerTransformer.applyCallerPointcuts(clazz, advisor);
    }
-   
+
    /**
     * Find all classes that this class references.  If any of those classes are advised and have field and/or constructor
     * interception, do instrumentation on this class so that those fields and constructors are instrumented
@@ -598,7 +598,7 @@
       try
       {
          AOPClassPool pool = AOPClassPool.createAOPClassPool(clazz.getClassPool(), AOPClassPoolRepository.getInstance());
-         
+
          //Class.getRefClasses() only gets classes explicitly referenced in the class. We need to check the super classes and do some extra handling
          for (ReferenceClassIterator it = new ReferenceClassIterator(clazz.getRefClasses()) ; it.hasNext() ; )
          {
@@ -631,12 +631,12 @@
                }
             }
             if (!isTransformable(ctRef)) continue;
-            
+
             it.addSuperClass(ctRef);
-            
+
             ClassAdvisor advisor = manager.getTempClassAdvisor(ctRef);
-            
-            
+
+
             if (!manager.getInterceptionMarkers().shouldSkipFieldAccess(ref) && !ref.equals(clazz.getName()))
             {
                List fields = getAdvisableFields(ctRef);
@@ -690,7 +690,7 @@
             isAdvised(clazz) ||
             !isTransformable(clazz));
    }
-   
+
    /**
     * Makes class advisable.
     */
@@ -701,7 +701,7 @@
       {
          if (shouldNotTransform(clazz)) return false;
          if (AspectManager.verbose && logger.isDebugEnabled()) logger.debug("trying to transform " + clazz.getName());
-         
+
          DeclareChecker.checkDeclares(manager, clazz, advisor);
 
          boolean converted = instrumentAnnotationIntroductions(clazz, advisor);
@@ -725,7 +725,7 @@
          instrumentIntroductions(clazz, advisor);
 
          converted = convertReferences(clazz) || converted;
-         
+
          boolean shouldReplaceArrayAccess = replaceArrayAccess(clazz, advisor);
          converted = converted || shouldReplaceArrayAccess;
 
@@ -760,7 +760,7 @@
          {
             processedClasses.add(clazz);
          }
-         
+
          if (AspectManager.verbose && logger.isDebugEnabled()) logger.debug("was " + clazz.getName() + " converted: " + (basicsSet || converted));
 
          if (basicsSet || converted)
@@ -910,7 +910,7 @@
       clazz.addInterface(forName(AOP_PACKAGE + ".Advised"));
       doSetupBasics(clazz);
    }
-   
+
    /**
     * Notifies the <code>Instrumentor</code> that some joinpoint status were updated.
     * This method hot swaps the code of afected classes.
@@ -930,7 +930,7 @@
             CtClass clazz = update.clazz;
             JoinpointStatusUpdate.ClassJoinpoints wrapTargets = update.newlyAdvisedJoinpoints;
             JoinpointStatusUpdate.ClassJoinpoints unwrapTargets = update.newlyUnadvisedJoinpoints;
-            
+
             clazz.defrost();
             fieldAccessTransformer.wrap(clazz, wrapTargets.fieldReads, wrapTargets.fieldWrites);
             fieldAccessTransformer.unwrap(clazz, unwrapTargets.fieldReads, unwrapTargets.fieldWrites);
@@ -950,7 +950,7 @@
          Collection conversionsRegistered = new HashSet();
          synchronized(this.processedClasses)
          {
-            for (Iterator iterator2 = processedClasses.iterator(); iterator2.hasNext(); ) {       
+            for (Iterator iterator2 = processedClasses.iterator(); iterator2.hasNext(); ) {
 
                CtClass clazz = (CtClass) iterator2.next();
                if (manager.isNonAdvisableClassName(clazz.getName()) || ! isTransformable(clazz))
@@ -977,7 +977,7 @@
          // notifies code conversion observers
          fieldAccessTransformer.codeConverted();
          constructorExecutionTransformer.codeConverted();
-         
+
          // registers the classes bytecodes to be hot swapped
          for (Iterator iterator = classes.iterator(); iterator.hasNext(); )
          {
@@ -1027,27 +1027,27 @@
 
       if (shouldReplaceArrayAccess)
       {
-         if (AspectManager.verbose) System.out.println("[debug] Replacing array access in " + clazz.getName());
+		  if (AspectManager.verbose && logger.isDebugEnabled()) logger.debug("[debug] Replacing array access in " + clazz.getName());
          converter.replaceArrayAccess(classPool.get(ArrayAdvisor.class.getName()), new CodeConverter.DefaultArrayAccessReplacementMethodNames());
       }
       return shouldReplaceArrayAccess;
    }
 
-   
+
    /**
     * Converts all processed classes to make wrapping of the appropriate joinpoints.
-    * This method must be called if some dynamic transformation ocurred (i. e. a 
+    * This method must be called if some dynamic transformation ocurred (i. e. a
     * class has just been loaded and one or more of its joinpoints were wrapped due
     * only to bindings added dynamicaly; in this case, the previously loaded classes
     * may not call the wrappers of this joinpoints, and need to be instrumented).
-    * 
+    *
     * @param hotSwapper responsible for performing any hot swapping operations when
     *                   needed.
     * @param clazz the clazz whose transformation involved dynamic wrapping.
     * @param fieldReads collection of fields whose read joinpoit was dynamicaly wrapped.
     * @param fieldWrites collection of fields whose read joinpoit was dynamicaly wrapped.
     * @param constructor <code>true</code> if the <code>clazz</code> constructors were
-    * dynamicaly wrapped. 
+    * dynamicaly wrapped.
     */
    public void convertProcessedClasses(HotSwapper hotSwapper, CtClass clazz,
          Collection fieldReads, Collection fieldWrites, boolean constructor)
@@ -1068,7 +1068,7 @@
       {
          codeConverter.replaceNew(clazz, clazz, ConstructorExecutionTransformer.constructorFactory(clazz.getSimpleName()));
       }
-         
+
       synchronized(processedClasses)
       {
       for (Iterator iterator = processedClasses.iterator(); iterator.hasNext();)
@@ -1116,9 +1116,9 @@
       }
       hotSwapper.hotSwap();
    }
-   
+
    protected abstract void doSetupBasics(CtClass clazz) throws CannotCompileException, NotFoundException;
-   
+
    /**
     * Creates generic invoke method to be wrapped by real signatures.
     */
@@ -1132,7 +1132,7 @@
       ArrayList classes;
       HashSet handledClasses;
       String currentEntry;
-      
+
       public ReferenceClassIterator(Collection refClasses)
       {
          size = refClasses.size();
@@ -1160,7 +1160,7 @@
       {
          return currentEntry;
       }
-      
+
       void addSuperClass(CtClass clazz)throws NotFoundException
       {
          if (clazz != null)
@@ -1178,7 +1178,7 @@
          }
       }
    }
-   
+
    AspectManager getManager()
    {
       return manager;

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/instrument/JoinPointGenerator.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/instrument/JoinPointGenerator.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/instrument/JoinPointGenerator.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -44,8 +44,10 @@
 import javassist.Modifier;
 import javassist.NotFoundException;
 
+import org.jboss.aop.Advisor;
 import org.jboss.aop.AspectManager;
 import org.jboss.aop.CallerConstructorInfo;
+import org.jboss.aop.ClassAdvisor;
 import org.jboss.aop.GeneratedClassAdvisor;
 import org.jboss.aop.InstanceAdvisor;
 import org.jboss.aop.JoinPointInfo;
@@ -517,7 +519,19 @@
       else
       {
          AspectManager manager = info.getAdvisor().getManager();
-         advisorClass = manager.getAdvisor(info.getClazz()).getClass();
+         try
+         {
+            advisorClass = manager.getAdvisor(info.getClazz()).getClass();
+         }
+         catch(ClassCastException e)
+         {
+            Advisor advisor = manager.findAdvisor(info.getClazz());
+            if (advisor != null && !( advisor instanceof ClassAdvisor))
+            {
+               //The advisor is a ClassContainer or something like that, so ignore this joinpoint
+               return;
+            }
+         }
       }
       
       try
@@ -2204,4 +2218,9 @@
          }
       }
    }  
+   
+   protected Field getJoinpointField()
+   {
+      return joinpointField;
+   }  
 }
\ No newline at end of file

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/instrument/MethodJoinPointGenerator.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/instrument/MethodJoinPointGenerator.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/instrument/MethodJoinPointGenerator.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -73,11 +73,15 @@
    {
       super(advisor, info, getParameters(info),
             info.getMethod().getParameterTypes().length, false);
-      if (!info.getUnadvisedMethod().getReturnType().equals(Void.TYPE))
+      if (super.getJoinpointField() != null)
       {
-         returnType = new WeakReference<Class<?>>(info.getUnadvisedMethod().getReturnType());
+         if (!info.getUnadvisedMethod().getReturnType().equals(Void.TYPE))
+         {
+            returnType = new WeakReference<Class<?>>(info.getUnadvisedMethod().getReturnType());
+         }
+         hasTargetObject = !Modifier.isStatic(info.getMethod().getModifiers());
       }
-      hasTargetObject = !Modifier.isStatic(info.getMethod().getModifiers());
+
    }
    
    private static JoinPointParameters getParameters(MethodInfo info)

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/instrument/NonOptimizedFieldAccessTransformer.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/instrument/NonOptimizedFieldAccessTransformer.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/instrument/NonOptimizedFieldAccessTransformer.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -43,7 +43,7 @@
    {
       super(instrumentor);
    }
-   
+
    protected void doBuildFieldWrappers(CtClass clazz, CtField field, int fieldIndex, boolean shouldReplaceArrayAccess, JoinpointClassification classificationGet, JoinpointClassification classificationSet)
    throws NotFoundException, CannotCompileException
    {
@@ -51,9 +51,9 @@
       boolean wrappedGet = classificationGet.equals(JoinpointClassification.WRAPPED);
       boolean wrappedSet = classificationSet.equals(JoinpointClassification.WRAPPED);
       int mod = getStaticModifiers(field);
-                  
-      //Create placeholder static wrappers, since without these methods replaceFieldAccessInternally() 
-      //will not compile. 
+
+      //Create placeholder static wrappers, since without these methods replaceFieldAccessInternally()
+      //will not compile.
       //If we add the actual static wrappers before calling replaceFieldAccessInternally()
       //field access done in the inner invocation classes as well as in the static wrappers
       //is replaced with a call to the wrapper instead, which means infinite recursion
@@ -66,19 +66,19 @@
             // prepareForWrapping
             wrapper.prepareForWrapping(field, GET_INDEX);
          }
-            
+
          if (isPrepared(classificationSet))
          {
             addFieldWriteInfoField(Modifier.PRIVATE | Modifier.STATIC, clazz, field);
             OptimizedFieldInvocations.createOptimizedInvocationClass(instrumentor, clazz, field, false);
             // prepareForWrapping
             wrapper.prepareForWrapping(field, SET_INDEX);
-         }  
+         }
       } catch (Exception e)
       {
          throw new CannotCompileException(e);
       }
-      
+
       // wrap
       if (wrappedGet)
       {
@@ -96,19 +96,19 @@
             instrumentor.dynamicTransformationObserver.fieldWriteDynamicalyWrapped(field);
          }
       }
-      
+
       // executeWrapping
       replaceFieldAccessInternally(clazz, field, wrappedGet, wrappedSet, fieldIndex);
       buildWrappers(clazz, field, shouldReplaceArrayAccess, wrappedGet, wrappedSet, fieldIndex);
-      
+
    }
-   
+
    private void buildWrappers(CtClass clazz, CtField field, boolean shouldReplaceArrayAccess, boolean doGet, boolean doSet, int index)
    throws NotFoundException, CannotCompileException
    {
       if (doGet)
       {
-         String code = getReadWrapperBody(clazz, field, index); 
+         String code = getReadWrapperBody(clazz, field, index);
          CtMethod method = clazz.getDeclaredMethod(fieldRead(field.getName()));
          method.setBody(code);
       }
@@ -116,10 +116,10 @@
       {
          String code = getWriteWrapperBody(clazz, field, shouldReplaceArrayAccess, index);
          CtMethod method = clazz.getDeclaredMethod(fieldWrite(field.getName()));
-         method.setBody(code);            
+         method.setBody(code);
       }
    }
-   
+
    protected String getWrapperBody(CtClass clazz, CtField field, boolean get, int index) throws NotFoundException, CannotCompileException
    {
       if (get)
@@ -129,7 +129,7 @@
 //    TODO: set replaceArrayAccess=false as default, must be verified.
       return getWriteWrapperBody(clazz, field, false, index);
    }
-   
+
    private String getReadWrapperBody(CtClass clazz, CtField field, int index)
    throws NotFoundException, CannotCompileException
    {
@@ -142,10 +142,10 @@
          access = "((" + clazz.getName() + ")$1).";
          instanceCheck = " || ((org.jboss.aop.ClassInstanceAdvisor)((org.jboss.aop.InstanceAdvised)$1)._getInstanceAdvisor()).hasInstanceAspects";
       }
-      
+
       // read wrapper
-     
-         return 
+
+         return
             "{ " +
             "    if (" + Instrumentor.HELPER_FIELD_NAME + ".hasAspects() " + instanceCheck + " ) " +
             "    { " +
@@ -153,10 +153,10 @@
             "    } " +
             "    return " + access + name + "; " +
             "}";
-      
+
    }
-   
-   private String getWriteWrapperBody(CtClass clazz, CtField field, boolean shouldReplaceArrayAccess, int index) 
+
+   private String getWriteWrapperBody(CtClass clazz, CtField field, boolean shouldReplaceArrayAccess, int index)
      throws NotFoundException, CannotCompileException
    {
       String name = field.getName();
@@ -178,9 +178,8 @@
           fieldString = clazz.getName() +  "." + field.getName();
       }
       // write wrapper
-      return 
+      return
       "{ " +
-      "    System.out.println(\"INSIDE getWriteWrapperBody for class: "+clazz.getName()+", field: "+field.getName()+", modifier: "+field.getModifiers()+"\");\n" +
       "    " + getArrayWriteRegistration(shouldReplaceArrayAccess, targetString, field, fieldString, "$2") +
       "    if (" + Instrumentor.HELPER_FIELD_NAME + ".hasAspects() " + instanceCheck + " ) " +
       "    { " +
@@ -253,7 +252,7 @@
             fieldAccess.replace(code);
          }
       }
-      
+
    }//End Inner class FieldAccessExprEditor
 
 }

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/joinpoint/Joinpoint.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/joinpoint/Joinpoint.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/joinpoint/Joinpoint.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -1,32 +1,32 @@
 /*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., 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.
-  */
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.joinpoint;
 
 /**
- * Comment
+ * Represents a joinpoint to be intercepted.
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  * @version $Revision$
  */
 public interface Joinpoint
 {
-}
+}
\ No newline at end of file

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/metadata/MetaDataResolver.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/metadata/MetaDataResolver.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/metadata/MetaDataResolver.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -1,32 +1,32 @@
 /*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., 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.
-  */
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.metadata;
 
 import org.jboss.aop.joinpoint.Invocation;
 
 /**
- * Classes implementing this interface use the
- * context of the Invocation to find metadata
- *
+ * The interface for resolving metadata contained in the context of
+ * {@link Invocation} instances.
+ * 
  * For instance, MethodMetaData extracts the Method from
  * the invocation.
  *
@@ -41,7 +41,10 @@
    public Object resolve(Invocation invocation, Object tag, Object attr);
 
    /**
-    * Get all metadata that belong with the context of this invocation
+    * Gets all metadata that belongs with the context of {@code invocation}
+    * 
+    * @param the invocation instance whose context metada is to be retrieved
+    * @return the metadata contained in the context of {@code invocation}
     */
    public SimpleMetaData getAllMetaData(Invocation invocation);
-}
+}
\ No newline at end of file

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/metadata/SimpleMetaData.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/metadata/SimpleMetaData.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/metadata/SimpleMetaData.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -1,57 +1,87 @@
 /*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., 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.
-  */
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.metadata;
 
 import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
+
 import org.jboss.aop.joinpoint.Invocation;
 import org.jboss.aop.util.MarshalledValue;
 import org.jboss.aop.util.PayloadKey;
 
 /**
+ * Contains all the metadata associated with an
+ * {@link org.jboss.aop.joinpoint.Invocation} instance.
+ * 
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  * @version $Revision$
  */
 public class SimpleMetaData implements MetaDataResolver, java.io.Externalizable
 {
    static final long serialVersionUID = -3873275588469743345L;
-   protected HashMap metaData = new HashMap();
+   
+   /**
+    * Contains all the metadata entries.
+    */
+   protected HashMap<Object, HashMap<Object, MetaDataValue>> metaData =
+         new HashMap<Object, HashMap<Object, MetaDataValue>>();
 
+   /**
+    * Contains the value of a metadata attribute. 
+    */
    public class MetaDataValue implements java.io.Serializable
    {
       static final long serialVersionUID = -8024138149680591337L;
       public final PayloadKey type;
       public Object value;
 
+      /**
+       * Constructs a metada data entry with the initial value {@code value}.
+       * 
+       * @param type  payload type
+       * @param value the initial value of this entry
+       */
       public MetaDataValue(PayloadKey type, Object value)
       {
          this.type = type;
          this.value = value;
       }
 
-      public Object get()
-      throws java.io.IOException, ClassNotFoundException
+      /**
+       * Returns the value of this entry.
+       * 
+       * @return the value of this metadata entry.
+       * @throws IOException            may be thrown during unmarshalling proccess
+       *                                (only if payload key type is
+       *                                {@link PayloadKey#MARSHALLED}) 
+       * @throws ClassNotFoundException may be thrown during unmarshalling proccess
+       *                                (only if payload key type is
+       *                                {@link PayloadKey#MARSHALLED})
+       */
+      public Object get() throws IOException, ClassNotFoundException
       {
          if (value instanceof MarshalledValue)
          {
@@ -60,6 +90,7 @@
          return value;
       }
       
+      @Override
       public String toString()
       {
          StringBuffer sb = new StringBuffer(100);
@@ -72,16 +103,34 @@
 
    }
 
+   /**
+    * Returns the number of items contained in this simple metadata instance.
+    * 
+    * @return the number of items contained in this simple metadata instance.
+    */
    public synchronized int size()
    {
       return metaData.size();
    }
 
-   public synchronized HashSet tags()
+   /**
+    * Returns the tags that identify the metadata elements contained in this
+    * instance.
+    *  
+    * @return a set containing all tags of the metadata elements contained in this
+    *         instance.
+    */
+   public synchronized HashSet<Object> tags()
    {
-      return new HashSet(metaData.keySet());
+      return new HashSet<Object>(metaData.keySet());
    }
 
+   /**
+    * Returns the metadata tagged with {@code name}.
+    * 
+    * @param name tag of the queried metadata
+    * @return a map containing all the metadata tagged with {@code name}
+    */
    public synchronized HashMap tag(String name)
    {
       HashMap map = (HashMap) metaData.get(name);
@@ -89,46 +138,75 @@
       return (HashMap) map.clone();
    }
 
+   /**
+    * Indicates whether this instance contains metadata tagged with {@code name}.
+    *  
+    * @param name tag of the queried metadata
+    * @return {@code true} only if there is metadata tagged with {@code name} in this
+    *         simple metadata instance
+    */
    public synchronized boolean hasTag(String name)
    {
       return metaData.get(name) != null;
    }
 
    /**
-    * Tag metadata to structure.  Use for tags with no attributes
-    * i.e. @Singleton, etc...
+    * Tags metadata to structure.  Use for tags with no attributes (i.e.
+    * &#64;Singleton, etc...)
     *
-    * @param group
+    * @param tag the tag that represents the no-atribute metadata to be added
     */
    public void tag(Object tag)
    {
       addMetaData(tag, EMPTY_TAG, new Object(), PayloadKey.TRANSIENT);
    }
 
+   /**
+    * Adds a metadata attribute/value pair to this instance.
+    * 
+    * @param tag   identifies the metadata attribute to be added
+    * @param attr  the name of an attribute
+    * @param value the value of {@code attr} attribute
+    */
    public void addMetaData(Object tag, Object attr, Object value)
    {
       addMetaData(tag, attr, value, PayloadKey.MARSHALLED);
    }
 
+   /**
+    * Adds a metadata attribute/value pair to this instance.
+    * 
+    * @param tag   identifies the metadata attribute to be added
+    * @param attr  the name of an attribute
+    * @param value the value of {@code attr} attribute
+    * @param type  the payload type
+    */
    public synchronized void addMetaData(Object tag, Object attr, Object value, PayloadKey type)
    {
-      HashMap groupData = (HashMap) metaData.get(tag);
+      HashMap<Object, MetaDataValue> groupData = metaData.get(tag);
       if (groupData == null)
       {
-         groupData = new HashMap();
+         groupData = new HashMap<Object, MetaDataValue>();
          metaData.put(tag, groupData);
       }
       MetaDataValue val = new MetaDataValue(type, value);
       groupData.put(attr, val);
    }
 
+   /**
+    * Returns the value of a metadata attribute.
+    * 
+    * @param tag   identifies the metadata attribute to be retrieved
+    * @param attr  the name of an attribute
+    * @return      the value of {@code attr} attribute
+    */
    public synchronized Object getMetaData(Object tag, Object attr)
    {
       try
       {
-         HashMap groupData = (HashMap) metaData.get(tag);
+         HashMap<Object, MetaDataValue> groupData = metaData.get(tag);
          if (groupData == null) return null;
-         MetaDataValue val = (MetaDataValue) groupData.get(attr);
+         MetaDataValue val = groupData.get(attr);
          if (val == null) return null;
          return val.get();
       }
@@ -142,6 +220,12 @@
       }
    }
 
+   /**
+    * Removes the metadata attribute from this instance.
+    * 
+    * @param tag   identifies the metadata attribute to be removed
+    * @param attr  name of the attribute to be removed
+    */
    public synchronized void removeMetaData(Object tag, Object attr)
    {
       HashMap groupData = (HashMap) metaData.get(tag);
@@ -151,18 +235,31 @@
       }
    }
 
+   /**
+    * Removes all attributes identified by the tag {@code group}.
+    * 
+    * @param group identifies the attributes to be removed
+    */
    public synchronized void removeGroupData(Object group)
    {
       metaData.remove(group);
    }
 
+   /**
+    * Erases all the metadata contained in this instance.
+    *
+    */
    public synchronized void clear()
    {
       metaData.clear();
    }
 
    /**
-    * merges incoming data.  Incoming data overrides existing data
+    * Merges incoming data.
+    * If there is a crash in tags and attributes names, incoming data will override
+    * the existing data.
+    * 
+    * @param data incoming that that should be merged to this instance.
     */
    public synchronized void mergeIn(SimpleMetaData data)
    {
@@ -170,11 +267,11 @@
       while (it.hasNext())
       {
          Object tag = it.next();
-         HashMap attrs = (HashMap) data.metaData.get(tag);
-         HashMap map = (HashMap) metaData.get(tag);
+         HashMap<Object, MetaDataValue> attrs = data.metaData.get(tag);
+         HashMap<Object, MetaDataValue> map = metaData.get(tag);
          if (map == null)
          {
-            map = new HashMap();
+            map = new HashMap<Object, MetaDataValue>();
             this.metaData.put(tag, map);
          }
          map.putAll(attrs);
@@ -191,11 +288,10 @@
       return this;
    }
 
-   public void writeExternal(java.io.ObjectOutput out)
-   throws IOException
+   public void writeExternal(ObjectOutput out) throws IOException
    {
       //System.out.println("******** marshalling metadata");
-      Iterator it = metaData.keySet().iterator();
+      Iterator<Object> it = metaData.keySet().iterator();
       while (it.hasNext())
       {
          Object group = it.next();
@@ -232,16 +328,18 @@
       out.writeObject(null); // place holder for end of marshall
    }
 
-   public void readExternal(java.io.ObjectInput in)
-   throws IOException, ClassNotFoundException
+   /**
+    * {@inheritDoc}
+    */
+   public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
    {
       //System.out.println("******** unmarshalling metadata");
-      metaData = new HashMap();
+      metaData = new HashMap<Object, HashMap<Object, MetaDataValue>>();
       Object group;
       while ((group = in.readObject()) != null)
       {
          //System.out.println("******** unmarshalling group: " + group);
-         HashMap map = new HashMap();
+         HashMap<Object, MetaDataValue> map = new HashMap<Object, MetaDataValue>();
          metaData.put(group, map);
          Object attr;
          while ((attr = in.readObject()) != null)

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/proxy/container/ContainerProxyFactory.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/proxy/container/ContainerProxyFactory.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/proxy/container/ContainerProxyFactory.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -248,9 +248,10 @@
       {
          addMethodFromTemplate(template, "equals", equalsBody());
          addMethodFromTemplate(template, "hashCode", hashCodeBody());
-         addMethodFromTemplate(template, "toString", toStringBody());
       }
-      
+
+      addMethodFromTemplate(template, "toString", toStringBody());
+
       copyAnnotations(superclass, proxy);
       copySignature(superclass, proxy);
       
@@ -351,9 +352,9 @@
       return 
          "{" +
          "   if (delegate != null)" +
-         "      return delegate.toString();" +
+         "      return delegate.toString() + \" (proxied by \" + this.getClass().getName() + \"@\" + java.lang.Integer.toHexString(java.lang.System.identityHashCode(this)) + \")\";" +
          "   else" +
-         "      return super.toString();" +
+         "      return super.toString() + \" (empty proxy of \" + this.getClass().getSuperclass().getName() + \")\";" +
          "}";
    }
 

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/proxy/container/ProxyTemplate.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/proxy/container/ProxyTemplate.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/proxy/container/ProxyTemplate.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -129,11 +129,19 @@
    public String toString()
    {
       if (delegate != null)
-         return delegate.toString();
+         return delegate.toString() + " (proxied by " + this.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(this)) + ")";
       else
-         return super.toString();
+         return super.toString() + "(empty proxy of " + this.getClass().getSuperclass().getName() + ")";
    }
    
+//   "{" +
+//   "   if (delegate != null)" +
+//   "      return delegate.toString() + \" (proxied by \" + this.getClass().getName() + \"@\" + java.lang.Integer.toHexString(java.lang.System.identityHashCode(this)) + \")\";" +
+//   "   else" +
+//   "      return super.toString() + \" (empty proxy of \" + this.getClass().getSuperclass().getName() + \")\";" +
+//   "}";
+
+   
    private void writeObject(java.io.ObjectOutputStream out) throws IOException
    {
       out.writeObject(delegate);

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/util/MarshalledValue.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/util/MarshalledValue.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/util/MarshalledValue.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -1,24 +1,24 @@
 /*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., 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.
-  */
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.util;
 
 import java.io.ByteArrayInputStream;
@@ -88,11 +88,21 @@
       return mvis.readObject();
    }
 
+   /**
+    * Returns the serialized form of this value.
+    * 
+    * @return the serialized form of this value
+    */
    public byte[] toByteArray()
    {
       return serializedForm;
    }
 
+   /**
+    * Returns the length of this value's serialized form.
+    * 
+    * @return the length of {@link #toByteArray()}
+    */
    public int size()
    {
       int size = serializedForm != null ? serializedForm.length : 0;
@@ -122,6 +132,14 @@
       return hashCode;
    }
 
+   /**
+    * Compares {@code obj} with this instance for equality.
+    * Returns {@code true} if and only if {@code obj} is also a marshalled value,
+    * whose value is the same as the one contained in this instance.
+    * 
+    * @param obj the object to be compared for equality with this instance
+    * @return {@code true} if {@code obj} is considered equal to this instance
+    */
    public boolean equals(Object obj)
    {
       if( this == obj )

Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/util/PayloadKey.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/util/PayloadKey.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/util/PayloadKey.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -1,24 +1,24 @@
 /*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., 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.
-  */
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.util;
 
 import java.io.ObjectStreamException;
@@ -26,7 +26,7 @@
 import java.util.ArrayList;
 
 /**
- * Type safe enumeration used for to identify the payloads.
+ * Type safe enumeration used for to identify the payloads. 
  */
 public final class PayloadKey implements Serializable
 {
@@ -36,7 +36,7 @@
    // these fields are used for serialization
    private static int nextOrdinal = 0;
 
-   private static final ArrayList values = new ArrayList(3);
+   private static final ArrayList<PayloadKey> values = new ArrayList<PayloadKey>(3);
 
    /** Put me in the transient map, not part of payload. */
    public final static PayloadKey TRANSIENT = new PayloadKey("TRANSIENT");
@@ -59,6 +59,7 @@
       values.add(this);
    }
 
+   @Override
    public String toString()
    {
       return name;
@@ -68,4 +69,4 @@
    {
       return values.get(ordinal);
    }
-}
+}
\ No newline at end of file

Modified: projects/aop/branches/joinpoint_graph/aop/src/resources/test/annotationoverride/jboss-aop.xml
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/resources/test/annotationoverride/jboss-aop.xml	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/resources/test/annotationoverride/jboss-aop.xml	2008-01-03 15:50:50 UTC (rev 68601)
@@ -14,6 +14,7 @@
 		@org.jboss.test.aop.annotationoverride.Other(value="field")
 	</annotation>
 
+
 	<annotation expr="class(org.jboss.test.aop.annotationoverride.Proxied)">
 		@org.jboss.test.aop.annotationoverride.Some
 	</annotation>

Modified: projects/aop/branches/joinpoint_graph/aop/src/resources/test/nameddomain/jboss-aop.xml
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/resources/test/nameddomain/jboss-aop.xml	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/resources/test/nameddomain/jboss-aop.xml	2008-01-03 15:50:50 UTC (rev 68601)
@@ -1,3 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
 <aop>
    <interceptor class="org.jboss.test.aop.nameddomain.SimpleInterceptor"/>
    <bind pointcut="execution(* org.jboss.test.aop.nameddomain.POJO->someMethod())">

Modified: projects/aop/branches/joinpoint_graph/aop/src/resources/test/regression/jboss-aop.xml
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/resources/test/regression/jboss-aop.xml	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/resources/test/regression/jboss-aop.xml	2008-01-03 15:50:50 UTC (rev 68601)
@@ -171,4 +171,12 @@
    </bind>
    
    <prepare expr="all(org.jboss.test.aop.regression.jbaop442instancedomain.POJO)"/>
+   
+ 	<bind pointcut="execution(* org.jboss.test.aop.regression.jbaop484superproxyadvised.Child->*(..))">
+	   <interceptor class="org.jboss.test.aop.regression.jbaop484superproxyadvised.TestInterceptor"/>
+	</bind>
+	<bind pointcut="execution(* $instanceof{org.jboss.test.aop.regression.jbaop484superproxyadvised.ChildInterface}->$implements{org.jboss.test.aop.regression.jbaop484superproxyadvised.ChildInterface}(..))">
+	   <interceptor class="org.jboss.test.aop.regression.jbaop484superproxyadvised.TestInterceptor"/>
+	</bind>
+   
 </aop>
\ No newline at end of file

Modified: projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/AnnotationOverrideTestCase.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/AnnotationOverrideTestCase.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/AnnotationOverrideTestCase.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -21,6 +21,7 @@
 */ 
 package org.jboss.test.aop.annotationoverride;
 
+import java.lang.annotation.Annotation;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
@@ -32,6 +33,17 @@
 import org.jboss.aop.Advisor;
 import org.jboss.aop.AspectManager;
 import org.jboss.aop.ClassContainer;
+import org.jboss.metadata.plugins.loader.memory.MemoryMetaDataLoader;
+import org.jboss.metadata.plugins.repository.basic.BasicMetaDataRepository;
+import org.jboss.metadata.spi.MetaData;
+import org.jboss.metadata.spi.repository.MutableMetaDataRepository;
+import org.jboss.metadata.spi.retrieval.MetaDataRetrievalToMetaDataBridge;
+import org.jboss.metadata.spi.scope.CommonLevels;
+import org.jboss.metadata.spi.scope.ScopeKey;
+import org.jboss.metadata.spi.signature.ConstructorSignature;
+import org.jboss.metadata.spi.signature.FieldSignature;
+import org.jboss.metadata.spi.signature.MethodSignature;
+import org.jboss.metadata.spi.signature.Signature;
 import org.jboss.test.aop.AOPTestWithSetup;
 
 /**
@@ -54,57 +66,231 @@
       return suite;
    }
 
-   public void testWovenClass() throws Exception
+   public void testWovenClassNoMetaData() throws Exception
    {
+      runTests(false);
+   }
+   
+   public void testWovenClassWithMetaData() throws Exception
+   {
+      runTests(true);
+   }
+   
+   public void testClassContainerProxiedClass() throws Exception
+   {
+      ClassContainer container = new ClassContainer("test", AspectManager.instance());
+      container.setClass(Proxied.class);
+      container.initializeClassContainer();
+      
+      Some some = (Some)container.resolveAnnotation(Some.class);
+      assertNotNull(some);
+      Other other = (Other)container.resolveAnnotation(Other.class);
+      assertNull(other);
+      
+      Method m = Proxied.class.getDeclaredMethod("method");
+      some = (Some)container.resolveAnnotation(m, Some.class);
+      assertNull(some);
+      other = (Other)container.resolveAnnotation(m, Other.class);
+      assertNotNull(other);
+      assertEquals("method", other.value());
+   }
+
+   private void runTests(boolean useMetaData) throws Exception
+   {
       Woven woven = new Woven();
       Advisor advisor = ((Advised)woven)._getAdvisor();
+
+      Method m = Woven.class.getDeclaredMethod("method"); 
+      Field f = Woven.class.getDeclaredField("field");
+      Constructor<Woven> c = Woven.class.getDeclaredConstructor();
+
+      if (useMetaData)
+      {
+         Annotation[] classAnnotations = new Annotation[] {new SomeMDImpl()};
+         Annotation[] ctorAnnotations = new Annotation[] {new OtherMDImpl("ctor")}; 
+         Annotation[] methodAnnotations = new Annotation[] {new OtherMDImpl("method")};
+         Annotation[] fieldAnnotations = new Annotation[] {new OtherMDImpl("field")};
+         setupMetaData(advisor, c, m, f, classAnnotations, ctorAnnotations, methodAnnotations, fieldAnnotations);
+      }
       
       Some some = (Some)advisor.resolveAnnotation(Some.class);
       assertNotNull(some);
       Other other = (Other)advisor.resolveAnnotation(Other.class);
       assertNull(other);
       
-      Method m = Woven.class.getDeclaredMethod("method");
+      SomeAnnotation someAnn = (SomeAnnotation)advisor.resolveAnnotation(SomeAnnotation.class);
+      assertNotNull(someAnn);
+      OtherAnnotation otherAnn = (OtherAnnotation)advisor.resolveAnnotation(OtherAnnotation.class);
+      assertNull(otherAnn);
+      
+      if (useMetaData)
+      {
+         SomeMD someMD = (SomeMD)advisor.resolveAnnotation(SomeMD.class);
+         assertNotNull(someMD);
+         OtherMD otherMD = (OtherMD)advisor.resolveAnnotation(OtherMD.class);
+         assertNull(otherMD);
+      }
+      
       some = (Some)advisor.resolveAnnotation(m, Some.class);
       assertNull(some);
       other = (Other)advisor.resolveAnnotation(m, Other.class);
       assertNotNull(other);
       assertEquals("method", other.value());
       
-      Field f = Woven.class.getDeclaredField("field");
+      someAnn = (SomeAnnotation)advisor.resolveAnnotation(m, SomeAnnotation.class);
+      assertNull(some);
+      otherAnn = (OtherAnnotation)advisor.resolveAnnotation(m, OtherAnnotation.class);
+      assertNotNull(otherAnn);
+      assertEquals("method", otherAnn.value());
+      
+      if (useMetaData)
+      {
+         SomeMD someMD = (SomeMD)advisor.resolveAnnotation(m, SomeMD.class);
+         assertNull(someMD);
+         OtherMD otherMD = (OtherMD)advisor.resolveAnnotation(m, OtherMD.class);
+         assertNotNull(otherMD);
+         assertEquals("method", otherMD.value());
+      }
+      
       some = (Some)advisor.resolveAnnotation(f, Some.class);
       assertNull(some);
       other = (Other)advisor.resolveAnnotation(f, Other.class);
       assertNotNull(other);
       assertEquals("field", other.value());
       
-      Constructor<Woven> c = Woven.class.getDeclaredConstructor();
+      someAnn = (SomeAnnotation)advisor.resolveAnnotation(f, SomeAnnotation.class);
+      assertNull(some);
+      otherAnn = (OtherAnnotation)advisor.resolveAnnotation(f, OtherAnnotation.class);
+      assertNotNull(other);
+      assertEquals("field", other.value());
+      
+      if (useMetaData)
+      {
+         SomeMD someMD = (SomeMD)advisor.resolveAnnotation(f, SomeMD.class);
+         assertNull(someMD);
+         OtherMD otherMD = (OtherMD)advisor.resolveAnnotation(f, OtherMD.class);
+         assertNotNull(otherMD);
+         assertEquals("field", otherMD.value());
+      }
+      
       some = (Some)advisor.resolveAnnotation(c, Some.class);
       assertNull(some);
       other = (Other)advisor.resolveAnnotation(c, Other.class);
       assertNotNull(other);
       assertEquals("ctor", other.value());
+
+      someAnn = (SomeAnnotation)advisor.resolveAnnotation(c, SomeAnnotation.class);
+      assertNull(some);
+      otherAnn = (OtherAnnotation)advisor.resolveAnnotation(c, OtherAnnotation.class);
+      assertNotNull(other);
+      assertEquals("ctor", other.value());
+      
+      if (useMetaData)
+      {
+         SomeMD someMD = (SomeMD)advisor.resolveAnnotation(c, SomeMD.class);
+         assertNull(someMD);
+         OtherMD otherMD = (OtherMD)advisor.resolveAnnotation(c, OtherMD.class);
+         assertNotNull(otherMD);
+         assertEquals("ctor", otherMD.value());
+      }
+      
+      assertTrue(advisor.hasAnnotation(SomeAnnotation.class.getName()));
+      assertTrue(advisor.hasAnnotation(Woven.class, SomeAnnotation.class.getName()));
+      assertTrue(advisor.hasAnnotation(Woven.class, SomeAnnotation.class));
+      
+      assertTrue(advisor.hasAnnotation(Some.class.getName()));
+      assertTrue(advisor.hasAnnotation(Woven.class, Some.class.getName()));
+      assertTrue(advisor.hasAnnotation(Woven.class, Some.class));
+      
+      assertFalse(advisor.hasAnnotation(Other.class.getName()));
+      assertFalse(advisor.hasAnnotation(Woven.class, Other.class.getName()));
+      assertFalse(advisor.hasAnnotation(Woven.class, Other.class));
+      
+      assertTrue(advisor.hasAnnotation(c, Other.class.getName()));
+      assertFalse(advisor.hasAnnotation(c, Some.class.getName()));
+      assertFalse(advisor.hasAnnotation(c, SomeAnnotation.class.getName()));
+      
+      assertTrue(advisor.hasAnnotation(f, Other.class.getName()));
+      assertFalse(advisor.hasAnnotation(f, Some.class.getName()));
+      assertFalse(advisor.hasAnnotation(f, SomeAnnotation.class.getName()));
+      
+      assertTrue(advisor.hasAnnotation(m, Other.class.getName()));
+      assertTrue(advisor.hasAnnotation(m, Other.class));
+      assertFalse(advisor.hasAnnotation(m, Some.class.getName()));
+      assertFalse(advisor.hasAnnotation(m, Some.class));
+      assertFalse(advisor.hasAnnotation(m, SomeAnnotation.class.getName()));
+      assertFalse(advisor.hasAnnotation(m, SomeAnnotation.class));
    }
    
-   public void testClassContainerProxiedClass() throws Exception
+   private void setupMetaData(Advisor advisor, 
+         Constructor<?> c, 
+         Method m, 
+         Field f, 
+         Annotation[] classAnnotations,
+         Annotation[] ctorAnnotations, 
+         Annotation[] methodAnnotations, 
+         Annotation[] fieldAnnotations)
    {
-      ClassContainer container = new ClassContainer("test", AspectManager.instance());
-      container.setClass(Proxied.class);
-      container.initializeClassContainer();
+      MutableMetaDataRepository repository = new BasicMetaDataRepository();
       
-      Some some = (Some)container.resolveAnnotation(Some.class);
-      assertNotNull(some);
-      Other other = (Other)container.resolveAnnotation(Other.class);
-      assertNull(other);
+      ScopeKey scopeKey = ScopeKey.DEFAULT_SCOPE.clone();
+      scopeKey.addScope(CommonLevels.INSTANCE, "Test");
+      scopeKey.addScope(CommonLevels.CLASS, advisor.getClazz().getName());
+      scopeKey.addScope(CommonLevels.WORK, String.valueOf(hashCode()));
+      ScopeKey key = scopeKey;
+      ScopeKey mutableScope = new ScopeKey(CommonLevels.INSTANCE, "Test".toString());
+      MemoryMetaDataLoader mutable = new MemoryMetaDataLoader(mutableScope);
+      repository.addMetaDataRetrieval(mutable);
+      addClassAnnotations(advisor.getClazz(), mutable, classAnnotations);
+      addMethodAnnotations(m, mutable, methodAnnotations);
+      addFieldAnnotations(f, mutable, fieldAnnotations);
+      addConstructorAnnotations(c, mutable, ctorAnnotations);
       
-      Method m = Proxied.class.getDeclaredMethod("method");
-      some = (Some)container.resolveAnnotation(m, Some.class);
-      assertNull(some);
-      other = (Other)container.resolveAnnotation(m, Other.class);
-      assertNotNull(other);
-      assertEquals("method", other.value());
+      MetaData metadata = new MetaDataRetrievalToMetaDataBridge(mutable); 
       
-      
+      advisor.setMetadata(metadata);
    }
-
+   
+   private void addClassAnnotations(Class<?> clazz, MemoryMetaDataLoader mutable, Annotation[] extraAnnotations)
+   {
+      Annotation[] anns = clazz.getAnnotations();
+      for (Annotation ann : anns)
+      {
+         mutable.addAnnotation(ann);
+      }
+      for (Annotation ann : extraAnnotations)
+      {
+         mutable.addAnnotation(ann);
+      }
+   }
+   
+   private void addMethodAnnotations(Method m, MemoryMetaDataLoader mutable, Annotation[] extraAnnotations)
+   {
+      addJoinpointAnnotations(mutable, new MethodSignature(m), m.getName(), m.getAnnotations(), extraAnnotations);
+   }
+   
+   private void addFieldAnnotations(Field f, MemoryMetaDataLoader mutable, Annotation[] extraAnnotations)
+   {
+      addJoinpointAnnotations(mutable, new FieldSignature(f), f.getName(), f.getAnnotations(), extraAnnotations);
+   }
+   
+   private void addConstructorAnnotations(Constructor<?> c, MemoryMetaDataLoader mutable, Annotation[] extraAnnotations)
+   {
+      addJoinpointAnnotations(mutable, new ConstructorSignature(c), c.getName(), c.getAnnotations(), extraAnnotations);
+   }
+   
+   private void addJoinpointAnnotations(MemoryMetaDataLoader mutable, Signature sig, String name, Annotation[] annotations, Annotation[] extraAnnotations)
+   {
+      ScopeKey scope = new ScopeKey(CommonLevels.JOINPOINT_OVERRIDE, name);
+      MemoryMetaDataLoader loader = new MemoryMetaDataLoader(scope);
+      for (Annotation ann : annotations)
+      {
+         loader.addAnnotation(ann);
+      }
+      for (Annotation ann : extraAnnotations)
+      {
+         loader.addAnnotation(ann);
+      }
+      mutable.addComponentMetaDataRetrieval(sig, loader);
+   }
 }

Copied: projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/OtherAnnotation.java (from rev 68600, projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotationoverride/OtherAnnotation.java)
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/OtherAnnotation.java	                        (rev 0)
+++ projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/OtherAnnotation.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -0,0 +1,39 @@
+/*
+* 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.test.aop.annotationoverride;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Retention(RetentionPolicy.RUNTIME) @Target({ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.METHOD})
+public @interface OtherAnnotation
+{
+   String value();
+}
+ 
\ No newline at end of file

Copied: projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/OtherMD.java (from rev 68600, projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotationoverride/OtherMD.java)
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/OtherMD.java	                        (rev 0)
+++ projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/OtherMD.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -0,0 +1,32 @@
+/*
+* 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.test.aop.annotationoverride;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public @interface OtherMD 
+{
+   String value();
+}

Copied: projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/OtherMDImpl.java (from rev 68600, projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotationoverride/OtherMDImpl.java)
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/OtherMDImpl.java	                        (rev 0)
+++ projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/OtherMDImpl.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -0,0 +1,50 @@
+/*
+* 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.test.aop.annotationoverride;
+
+import java.lang.annotation.Annotation;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class OtherMDImpl implements OtherMD
+{
+   String value;
+   
+   public OtherMDImpl(String value)
+   {
+      this.value = value;
+   }
+   
+   public String value()
+   {
+      return value;
+   }
+
+   public Class<? extends Annotation> annotationType()
+   {
+      return OtherMD.class;
+   }
+
+}

Copied: projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/SomeAnnotation.java (from rev 68600, projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotationoverride/SomeAnnotation.java)
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/SomeAnnotation.java	                        (rev 0)
+++ projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/SomeAnnotation.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -0,0 +1,38 @@
+/*
+* 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.test.aop.annotationoverride;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE)
+public @interface SomeAnnotation 
+{
+
+}

Copied: projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/SomeMD.java (from rev 68600, projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotationoverride/SomeMD.java)
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/SomeMD.java	                        (rev 0)
+++ projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/SomeMD.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -0,0 +1,31 @@
+/*
+* 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.test.aop.annotationoverride;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public @interface SomeMD {
+
+}

Copied: projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/SomeMDImpl.java (from rev 68600, projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotationoverride/SomeMDImpl.java)
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/SomeMDImpl.java	                        (rev 0)
+++ projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/SomeMDImpl.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -0,0 +1,38 @@
+/*
+* 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.test.aop.annotationoverride;
+
+import java.lang.annotation.Annotation;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class SomeMDImpl implements SomeMD
+{
+   public Class<? extends Annotation> annotationType()
+   {
+      return SomeMD.class;
+   }
+
+}

Modified: projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/Woven.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/Woven.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/annotationoverride/Woven.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -26,8 +26,15 @@
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
  * @version $Revision: 1.1 $
  */
-public class Woven
+ at SomeAnnotation
+public class Woven 
 {  
+   @OtherAnnotation("ctor")
+   Woven(){}
+   
+   @OtherAnnotation("field")
    int field;
+   
+   @OtherAnnotation("method") 
    void method() {}
 }

Modified: projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/rebuildingchain/RebuildThread.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/rebuildingchain/RebuildThread.java	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/rebuildingchain/RebuildThread.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -42,8 +42,8 @@
    {
       for(int i=0; i < 30; i++)
       {
+         linkNewAdvice();
          unlinkAdvice();
-         linkNewAdvice();
 
          if(isDone())
             return;

Copied: projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised (from rev 67173, projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised)

Deleted: projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/Base.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/Base.java	2007-11-16 14:59:22 UTC (rev 67173)
+++ projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/Base.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -1,46 +0,0 @@
-/*
-* 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.test.aop.regression.jbaop484superproxyadvised;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class Base
-{
-   public static boolean baseInvoked;
-   public void baseOnly()
-   {
-      baseInvoked = true;
-   }
-   
-   public void baseOverridden()
-   {
-      baseInvoked = true;
-   }
-   
-   public void setProperty(int i)
-   {
-      baseInvoked = true;
-   }
-}

Copied: projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/Base.java (from rev 67173, projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/Base.java)
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/Base.java	                        (rev 0)
+++ projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/Base.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -0,0 +1,46 @@
+/*
+* 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.test.aop.regression.jbaop484superproxyadvised;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class Base
+{
+   public static boolean baseInvoked;
+   public void baseOnly()
+   {
+      baseInvoked = true;
+   }
+   
+   public void baseOverridden()
+   {
+      baseInvoked = true;
+   }
+   
+   public void setProperty(int i)
+   {
+      baseInvoked = true;
+   }
+}

Deleted: projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/Child.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/Child.java	2007-11-16 14:59:22 UTC (rev 67173)
+++ projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/Child.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -1,41 +0,0 @@
-/*
-* 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.test.aop.regression.jbaop484superproxyadvised;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class Child extends Base
-{
-   public static boolean childInvoked;
-   public void childOnly()
-   {
-      childInvoked = true;
-   }
-   
-   public void baseOverridden()
-   {
-      childInvoked = true;
-   }
-}

Copied: projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/Child.java (from rev 67173, projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/Child.java)
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/Child.java	                        (rev 0)
+++ projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/Child.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -0,0 +1,41 @@
+/*
+* 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.test.aop.regression.jbaop484superproxyadvised;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class Child extends Base
+{
+   public static boolean childInvoked;
+   public void childOnly()
+   {
+      childInvoked = true;
+   }
+   
+   public void baseOverridden()
+   {
+      childInvoked = true;
+   }
+}

Deleted: projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/ChildInterface.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/ChildInterface.java	2007-11-16 14:59:22 UTC (rev 67173)
+++ projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/ChildInterface.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -1,34 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., 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.test.aop.regression.jbaop484superproxyadvised;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 44932 $
- */
-public interface ChildInterface
-{
-   void childOnly();
-
-   void baseOverridden();
-}

Copied: projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/ChildInterface.java (from rev 67173, projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/ChildInterface.java)
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/ChildInterface.java	                        (rev 0)
+++ projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/ChildInterface.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -0,0 +1,34 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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.test.aop.regression.jbaop484superproxyadvised;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 44932 $
+ */
+public interface ChildInterface
+{
+   void childOnly();
+
+   void baseOverridden();
+}

Deleted: projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/SuperClassIsAdvisedByProxyTestCase.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/SuperClassIsAdvisedByProxyTestCase.java	2007-11-16 14:59:22 UTC (rev 67173)
+++ projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/SuperClassIsAdvisedByProxyTestCase.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -1,201 +0,0 @@
-/*
-* 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.test.aop.regression.jbaop484superproxyadvised;
-
-import org.jboss.aop.Advised;
-import org.jboss.aop.AspectManager;
-import org.jboss.aop.advice.AdviceBinding;
-import org.jboss.aop.pointcut.ast.ParseException;
-import org.jboss.aop.proxy.container.AOPProxyFactory;
-import org.jboss.aop.proxy.container.AOPProxyFactoryParameters;
-import org.jboss.aop.proxy.container.AspectManaged;
-import org.jboss.aop.proxy.container.GeneratedAOPProxyFactory;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class SuperClassIsAdvisedByProxyTestCase extends TestCase
-{
-   AOPProxyFactory proxyFactory = new GeneratedAOPProxyFactory();
-
-   public static void main(String[] args)
-   {
-      TestRunner.run(suite());
-   }
-
-   public static Test suite()
-   {
-      TestSuite suite = new TestSuite("SuperClassIsAdvisedByProxyTestCase");
-      suite.addTestSuite(SuperClassIsAdvisedByProxyTestCase.class);
-      return suite;
-   }
-
-   public SuperClassIsAdvisedByProxyTestCase(String name)
-   {
-      super(name);
-   }
-
-   public void testClassAdvisorAndNotInstanceAdvisor() throws Exception
-   {
-      System.out.println("== Testing proxy");
-      Base base = new Base();
-      assertFalse(base instanceof Advised);
-      
-      String name = addBinding("execution(* org.jboss.test.aop.regression.jbaop484superproxyadvised.Base->*(..))", TestInterceptor.class);
-      try
-      {
-         Object proxy = createProxy(base);
-         assertTrue(proxy instanceof AspectManaged);
-         assertFalse(proxy instanceof Advised);
-         
-         TestInterceptor.reset();
-         base.baseOnly();
-         assertEquals(0, TestInterceptor.interceptions);
-         
-         TestInterceptor.reset();
-         base.baseOverridden();
-         assertEquals(0, TestInterceptor.interceptions);
-         
-         TestInterceptor.reset();
-         ((Base)proxy).baseOnly();
-         assertEquals(1, TestInterceptor.interceptions);
-         assertNotNull(TestInterceptor.invoked);
-         assertEquals("baseOnly", TestInterceptor.invoked.getName());
-         
-         TestInterceptor.reset();
-         ((Base)proxy).baseOverridden();
-         assertEquals(1, TestInterceptor.interceptions);
-         assertNotNull(TestInterceptor.invoked);
-         assertEquals("baseOverridden", TestInterceptor.invoked.getName());
-      }
-      finally
-      {
-         removeBinding(name);
-      }
-      
-      System.out.println("== Testing advised child");
-      name = addBinding("execution(* org.jboss.test.aop.regression.jbaop484superproxyadvised.Base->*(..))", TestInterceptor.class);
-      try
-      {
-         Child plainChild = new Child();
-         assertTrue(plainChild instanceof Advised);
-         assertFalse(plainChild instanceof AspectManaged);
-         
-         TestInterceptor.reset();
-         plainChild.baseOnly();
-         assertEquals(0, TestInterceptor.interceptions);
-   
-         TestInterceptor.reset();
-         plainChild.childOnly();
-         assertEquals(1, TestInterceptor.interceptions);
-   
-         TestInterceptor.reset();
-         plainChild.baseOverridden();
-         assertEquals(1, TestInterceptor.interceptions);
-      }
-      finally
-      {
-         removeBinding(name);
-      }
-
-      System.out.println("== Testing proxied child");
-      name = addBinding("execution(* org.jboss.test.aop.regression.jbaop484superproxyadvised.Base->*(..))", TestInterceptor.class);
-      Object proxy = null;
-      try
-      {
-   
-         Child proxiedChild = new Child();
-         assertTrue(proxiedChild instanceof Advised);
-         assertFalse(proxiedChild instanceof AspectManaged);
-   
-         proxy = createProxy(proxiedChild, new Class[] {ChildInterface.class});
-         
-         TestInterceptor.reset();
-         ((Child)proxy).baseOnly();
-         assertEquals(1, TestInterceptor.interceptions);
-         assertNotNull(TestInterceptor.invoked);
-         assertEquals("baseOnly", TestInterceptor.invoked.getName());
-   
-         TestInterceptor.reset();
-         ((Child)proxy).childOnly();
-         assertEquals(2, TestInterceptor.interceptions);
-         assertNotNull(TestInterceptor.invoked);
-         assertEquals("childOnly", TestInterceptor.invoked.getName());
-   
-         TestInterceptor.reset();
-         ((Child)proxy).baseOverridden();
-         assertEquals(2, TestInterceptor.interceptions);
-         assertNotNull(TestInterceptor.invoked);
-         assertEquals("baseOverridden", TestInterceptor.invoked.getName());
-      }
-      finally
-      {
-         removeBinding(name);
-      }
-      
-      TestInterceptor.reset();
-      ((Child)proxy).baseOnly();
-      assertEquals(1, TestInterceptor.interceptions);
-      
-   }
-   
-   private String addBinding(String pointcut, Class interceptor) throws ParseException
-   {
-      AdviceBinding binding = new AdviceBinding(pointcut, null);
-      String name = binding.getName();
-      binding.addInterceptor(interceptor);
-      AspectManager.instance().addBinding(binding);
-      return name;
-   }
-   
-   private void removeBinding(String name)
-   {
-      AspectManager.instance().removeBinding(name);
-   }
-   
-   private Object createProxy(Object target)
-   {
-      AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
-      params.setProxiedClass(target.getClass());
-      params.setTarget(target);
-      return proxyFactory.createAdvisedProxy(params);
-   }
-
-   protected Object createProxy(Object target, Class[] interfaces) throws Exception
-   {
-      AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
-      params.setProxiedClass(target.getClass());
-      params.setInterfaces(interfaces);
-      params.setTarget(target);
-      return proxyFactory.createAdvisedProxy(params);
-   }
-
-}
-
-

Copied: projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/SuperClassIsAdvisedByProxyTestCase.java (from rev 67173, projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/SuperClassIsAdvisedByProxyTestCase.java)
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/SuperClassIsAdvisedByProxyTestCase.java	                        (rev 0)
+++ projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/SuperClassIsAdvisedByProxyTestCase.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -0,0 +1,201 @@
+/*
+* 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.test.aop.regression.jbaop484superproxyadvised;
+
+import org.jboss.aop.Advised;
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.advice.AdviceBinding;
+import org.jboss.aop.pointcut.ast.ParseException;
+import org.jboss.aop.proxy.container.AOPProxyFactory;
+import org.jboss.aop.proxy.container.AOPProxyFactoryParameters;
+import org.jboss.aop.proxy.container.AspectManaged;
+import org.jboss.aop.proxy.container.GeneratedAOPProxyFactory;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class SuperClassIsAdvisedByProxyTestCase extends TestCase
+{
+   AOPProxyFactory proxyFactory = new GeneratedAOPProxyFactory();
+
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("SuperClassIsAdvisedByProxyTestCase");
+      suite.addTestSuite(SuperClassIsAdvisedByProxyTestCase.class);
+      return suite;
+   }
+
+   public SuperClassIsAdvisedByProxyTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testClassAdvisorAndNotInstanceAdvisor() throws Exception
+   {
+      System.out.println("== Testing proxy");
+      Base base = new Base();
+      assertFalse(base instanceof Advised);
+      
+      String name = addBinding("execution(* org.jboss.test.aop.regression.jbaop484superproxyadvised.Base->*(..))", TestInterceptor.class);
+      try
+      {
+         Object proxy = createProxy(base);
+         assertTrue(proxy instanceof AspectManaged);
+         assertFalse(proxy instanceof Advised);
+         
+         TestInterceptor.reset();
+         base.baseOnly();
+         assertEquals(0, TestInterceptor.interceptions);
+         
+         TestInterceptor.reset();
+         base.baseOverridden();
+         assertEquals(0, TestInterceptor.interceptions);
+         
+         TestInterceptor.reset();
+         ((Base)proxy).baseOnly();
+         assertEquals(1, TestInterceptor.interceptions);
+         assertNotNull(TestInterceptor.invoked);
+         assertEquals("baseOnly", TestInterceptor.invoked.getName());
+         
+         TestInterceptor.reset();
+         ((Base)proxy).baseOverridden();
+         assertEquals(1, TestInterceptor.interceptions);
+         assertNotNull(TestInterceptor.invoked);
+         assertEquals("baseOverridden", TestInterceptor.invoked.getName());
+      }
+      finally
+      {
+         removeBinding(name);
+      }
+      
+      System.out.println("== Testing advised child");
+      name = addBinding("execution(* org.jboss.test.aop.regression.jbaop484superproxyadvised.Base->*(..))", TestInterceptor.class);
+      try
+      {
+         Child plainChild = new Child();
+         assertTrue(plainChild instanceof Advised);
+         assertFalse(plainChild instanceof AspectManaged);
+         
+         TestInterceptor.reset();
+         plainChild.baseOnly();
+         assertEquals(0, TestInterceptor.interceptions);
+   
+         TestInterceptor.reset();
+         plainChild.childOnly();
+         assertEquals(1, TestInterceptor.interceptions);
+   
+         TestInterceptor.reset();
+         plainChild.baseOverridden();
+         assertEquals(1, TestInterceptor.interceptions);
+      }
+      finally
+      {
+         removeBinding(name);
+      }
+
+      System.out.println("== Testing proxied child");
+      name = addBinding("execution(* org.jboss.test.aop.regression.jbaop484superproxyadvised.Base->*(..))", TestInterceptor.class);
+      Object proxy = null;
+      try
+      {
+   
+         Child proxiedChild = new Child();
+         assertTrue(proxiedChild instanceof Advised);
+         assertFalse(proxiedChild instanceof AspectManaged);
+   
+         proxy = createProxy(proxiedChild, new Class[] {ChildInterface.class});
+         
+         TestInterceptor.reset();
+         ((Child)proxy).baseOnly();
+         assertEquals(1, TestInterceptor.interceptions);
+         assertNotNull(TestInterceptor.invoked);
+         assertEquals("baseOnly", TestInterceptor.invoked.getName());
+   
+         TestInterceptor.reset();
+         ((Child)proxy).childOnly();
+         assertEquals(2, TestInterceptor.interceptions);
+         assertNotNull(TestInterceptor.invoked);
+         assertEquals("childOnly", TestInterceptor.invoked.getName());
+   
+         TestInterceptor.reset();
+         ((Child)proxy).baseOverridden();
+         assertEquals(2, TestInterceptor.interceptions);
+         assertNotNull(TestInterceptor.invoked);
+         assertEquals("baseOverridden", TestInterceptor.invoked.getName());
+      }
+      finally
+      {
+         removeBinding(name);
+      }
+      
+      TestInterceptor.reset();
+      ((Child)proxy).baseOnly();
+      assertEquals(1, TestInterceptor.interceptions);
+      
+   }
+   
+   private String addBinding(String pointcut, Class interceptor) throws ParseException
+   {
+      AdviceBinding binding = new AdviceBinding(pointcut, null);
+      String name = binding.getName();
+      binding.addInterceptor(interceptor);
+      AspectManager.instance().addBinding(binding);
+      return name;
+   }
+   
+   private void removeBinding(String name)
+   {
+      AspectManager.instance().removeBinding(name);
+   }
+   
+   private Object createProxy(Object target)
+   {
+      AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
+      params.setProxiedClass(target.getClass());
+      params.setTarget(target);
+      return proxyFactory.createAdvisedProxy(params);
+   }
+
+   protected Object createProxy(Object target, Class[] interfaces) throws Exception
+   {
+      AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
+      params.setProxiedClass(target.getClass());
+      params.setInterfaces(interfaces);
+      params.setTarget(target);
+      return proxyFactory.createAdvisedProxy(params);
+   }
+
+}
+
+

Deleted: projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/TestInterceptor.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/TestInterceptor.java	2007-11-16 14:59:22 UTC (rev 67173)
+++ projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/TestInterceptor.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -1,60 +0,0 @@
-/*
-* 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.test.aop.regression.jbaop484superproxyadvised;
-
-import java.lang.reflect.Method;
-
-import org.jboss.aop.advice.Interceptor;
-import org.jboss.aop.joinpoint.Invocation;
-import org.jboss.aop.joinpoint.MethodInvocation;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class TestInterceptor implements Interceptor
-{
-   public static int interceptions;
-   public static Method invoked;
-
-   public String getName()
-   {
-      return null;
-   }
-
-   public Object invoke(Invocation invocation) throws Throwable
-   {
-      interceptions++;
-      if (invocation instanceof MethodInvocation)
-      {
-         invoked = ((MethodInvocation)invocation).getMethod();
-      }
-      return invocation.invokeNext();
-   }
-
-   public static void reset()
-   {
-      interceptions = 0;
-      invoked = null;
-   }
-}

Copied: projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/TestInterceptor.java (from rev 67173, projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/TestInterceptor.java)
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/TestInterceptor.java	                        (rev 0)
+++ projects/aop/branches/joinpoint_graph/aop/src/test/org/jboss/test/aop/regression/jbaop484superproxyadvised/TestInterceptor.java	2008-01-03 15:50:50 UTC (rev 68601)
@@ -0,0 +1,60 @@
+/*
+* 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.test.aop.regression.jbaop484superproxyadvised;
+
+import java.lang.reflect.Method;
+
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.joinpoint.Invocation;
+import org.jboss.aop.joinpoint.MethodInvocation;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestInterceptor implements Interceptor
+{
+   public static int interceptions;
+   public static Method invoked;
+
+   public String getName()
+   {
+      return null;
+   }
+
+   public Object invoke(Invocation invocation) throws Throwable
+   {
+      interceptions++;
+      if (invocation instanceof MethodInvocation)
+      {
+         invoked = ((MethodInvocation)invocation).getMethod();
+      }
+      return invocation.invokeNext();
+   }
+
+   public static void reset()
+   {
+      interceptions = 0;
+      invoked = null;
+   }
+}


Property changes on: projects/aop/branches/joinpoint_graph/asintegration
___________________________________________________________________
Name: svn:ignore
   - output
*.log
*.properties

   + output
*.log
*.properties
target


Modified: projects/aop/branches/joinpoint_graph/build/RELEASE_NOTES.html
===================================================================
--- projects/aop/branches/joinpoint_graph/build/RELEASE_NOTES.html	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/build/RELEASE_NOTES.html	2008-01-03 15:50:50 UTC (rev 68601)
@@ -1,9 +1,45 @@
 <html>
 <head>
-<title>Release Notes - JBoss AOP - Version 2.0.0.alpha5</title>
+<title>Release Notes - JBoss AOP - Version 2.0.0.CR2</title>
 </head>
 <body>
 
+<h2>Release Notes - JBoss AOP - Version 2.0.0.CR2</h2>
+    
+<h3>Bug</h3>
+<ul>
+<li>[<a href='http://jira.jboss.com/jira/browse/JBAOP-380'>JBAOP-380</a>] - JBoss AOP sets info field to null before rebuilding a chain</li>
+<li>[<a href='http://jira.jboss.com/jira/browse/JBAOP-480'>JBAOP-480</a>] - NPE in concurrent join point generation</li>
+<li>[<a href='http://jira.jboss.com/jira/browse/JBAOP-493'>JBAOP-493</a>] - Instrumentor.isBaseClass does not examine the whole hierarchy</li>
+<li>[<a href='http://jira.jboss.com/jira/browse/JBAOP-494'>JBAOP-494</a>] - Generated adviceString should take into account Aspect/Interceptor scope</li>
+</ul>
+
+<h2>Release Notes - JBoss AOP - Version 2.0.0.CR1</h2>
+
+<h3>Bug</h3>
+<ul>
+<li>[<a href='http://jira.jboss.com/jira/browse/JBAOP-305'>JBAOP-305</a>] - annotations not found for non-generic implementations of generic interface methods</li>
+<li>[<a href='http://jira.jboss.com/jira/browse/JBAOP-434'>JBAOP-434</a>] - StackOverflow error on ScopedJbossClassPool.getCached</li>
+<li>[<a href='http://jira.jboss.com/jira/browse/JBAOP-483'>JBAOP-483</a>] - Class(Proxy)Container does not populate the metadata</li>
+<li>[<a href='http://jira.jboss.com/jira/browse/JBAOP-484'>JBAOP-484</a>] - GeneratedAdvisor advised class with a super class that is a ContainerProxy gives CCE in JoinpointGenerator</li>
+<li>[<a href='http://jira.jboss.com/jira/browse/JBAOP-489'>JBAOP-489</a>] - Undeploy does not work if path has space characters</li>
+</ul>
+
+<h3>Feature Request</h3>
+<ul>
+<li>[<a href='http://jira.jboss.com/jira/browse/JBAOP-366'>JBAOP-366</a>] - Ability to attach a .aop deployment to a particular scoped classloader</li>
+<li>[<a href='http://jira.jboss.com/jira/browse/JBAOP-482'>JBAOP-482</a>] - AOP gives non-descriptive exception when annotation creation of an expression fails</li>
+<li>[<a href='http://jira.jboss.com/jira/browse/JBAOP-488'>JBAOP-488</a>] - Improve AOPContainerProxy.toString()</li>
+<li>[<a href='http://jira.jboss.com/jira/browse/JBAOP-490'>JBAOP-490</a>] - Advisor.resolveAnnotation() and hasAnnotation() should check the MetaData in all cases</li>
+</ul>
+
+<h3>Task</h3>
+<ul>
+<li>[<a href='http://jira.jboss.com/jira/browse/JBAOP-107'>JBAOP-107</a>] - The different types of classloader integration for AOP belong in the related release not jboss-head</li>
+<li>[<a href='http://jira.jboss.com/jira/browse/JBAOP-485'>JBAOP-485</a>] - Override Instrumentor.isBaseClass() in GeneratedAdvisorInstrumentor</li>
+<li>[<a href='http://jira.jboss.com/jira/browse/JBAOP-486'>JBAOP-486</a>] - Get rid of SuperClassesWeavingStrategy$CtClassTransformationInfo</li>
+</ul>
+
 <h2>Release Notes - JBoss AOP - Version 2.0.0.beta2</h2>
 
 <h3>Bug</h3>

Modified: projects/aop/branches/joinpoint_graph/build/build-thirdparty.xml
===================================================================
--- projects/aop/branches/joinpoint_graph/build/build-thirdparty.xml	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/build/build-thirdparty.xml	2008-01-03 15:50:50 UTC (rev 68601)
@@ -48,19 +48,19 @@
       <componentref name="beanshell" version="1.3.0"/>
       <componentref name="javassist" version="3.6.0.GA"/>
       <componentref name="jboss/backport-concurrent" version="2.1.0.GA"/>
-      <componentref name="jboss/common-core" version="2.2.1.GA"/>
+      <componentref name="jboss/common-core" version="2.2.3.GA"/>
       <componentref name="jboss/common-core-14" version="2.2.1.GA"/>
       <componentref name="jboss/common-logging-jdk" version="2.0.2.GA"/>
       <componentref name="jboss/common-logging-log4j" version="2.0.2.GA"/>
       <componentref name="jboss/common-logging-spi" version="2.0.2.GA"/>
       <componentref name="jboss/jboss-retro" version="1.1.2"/>
-      <componentref name="jboss/integration" version="5.0.0.Beta3"/>
-      <componentref name="jboss/microcontainer" version="2.0.0.Beta5"/>
+      <componentref name="jboss/integration" version="5.0.0.Beta4"/>
+      <componentref name="jboss/microcontainer" version="2.0.0.Beta9"/>
       <componentref name="jboss/microcontainer14" version="2.0.0.Beta4"/>
       <componentref name="jboss/profiler/jvmti" version="1.0.0.CR5"/>
       <componentref name="jboss/test" version="1.0.3.GA"/>
       <componentref name="jboss/test14" version="1.0.3.GA"/>
-		<componentref name="jboss/jboss-vfs" version="2.0.0.Beta5"/>
+		<componentref name="jboss/jboss-vfs" version="2.0.0.Beta6"/>
 		<componentref name="jbossas/core-libs" version="4.0.4.GA"/>
       <componentref name="junit" version="3.8.2-brew"/>
       <componentref name="qdox" version="1.6.1"/>

Modified: projects/aop/branches/joinpoint_graph/pom.xml
===================================================================
--- projects/aop/branches/joinpoint_graph/pom.xml	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/pom.xml	2008-01-03 15:50:50 UTC (rev 68601)
@@ -10,37 +10,16 @@
   <groupId>org.jboss.aop</groupId>
   <artifactId>jboss-aop-parent</artifactId>
   <packaging>pom</packaging>
-  <version>1-SNAPSHOT</version>
+  <version>2.0.0.CR1</version>
   <description>JBoss AOP</description>
   <name>JBoss AOP Framework</name>
   <url>http://labs.jboss.org/jbossaop/</url>
   <scm>
     <connection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/aop/trunk/</connection>
   </scm>
-  <repositories>
-    <repository>
-      <id>repository.jboss.org</id>
-      <name>JBoss Repository</name>
-      <layout>default</layout>
-      <url>http://repository.jboss.org/maven2/</url>
-      <snapshots>
-        <enabled>false</enabled>
-      </snapshots>
-    </repository>
-    <repository>
-      <id>snapshots.jboss.org</id>
-      <name>JBoss Snapshots Repository</name>
-      <layout>default</layout>
-      <url>http://snapshots.jboss.org/maven2/</url>
-      <snapshots>
-        <enabled>true</enabled>
-      </snapshots>
-    </repository>
-  </repositories>
   <modules>
     <module>aop</module>
     <module>aspects</module>
     <module>asintegration</module>
-    <module>maven-jbossaop-plugin</module>
   </modules>
 </project>

Modified: projects/aop/branches/joinpoint_graph/tools/etc/buildmagic/buildmagic.ent
===================================================================
--- projects/aop/branches/joinpoint_graph/tools/etc/buildmagic/buildmagic.ent	2008-01-03 14:38:47 UTC (rev 68600)
+++ projects/aop/branches/joinpoint_graph/tools/etc/buildmagic/buildmagic.ent	2008-01-03 15:50:50 UTC (rev 68601)
@@ -12,7 +12,7 @@
   <property name="buildmagic.ant16.baseversion" value="1.6"/>
 
   <!-- Set the version of the release here -->
-  <property name="aop.version" value="jboss-aop-2.0.0.beta2"/>
+  <property name="aop.version" value="jboss-aop-2.0.0.CR2"/>
   <property name="aop.title" value="JBoss AOP Framework"/>
   <property name="module.version" value="j${aop.version}"/>
 




More information about the jboss-cvs-commits mailing list