[jboss-cvs] JBossAS SVN: r68585 - in projects/aop/trunk/aop: src/main/org/jboss/aop and 4 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jan 1 22:37:28 EST 2008


Author: flavia.rainone at jboss.com
Date: 2008-01-01 22:37:28 -0500 (Tue, 01 Jan 2008)
New Revision: 68585

Modified:
   projects/aop/trunk/aop/build.xml
   projects/aop/trunk/aop/src/main/org/jboss/aop/AdviceType.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/Advised.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/GeneratedAdvised.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/InstanceAdvised.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/InstanceAdvisor.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/advice/AdviceType.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/advice/AspectDefinition.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/advice/AspectFactory.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/advice/Interceptor.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/advice/Scope.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/joinpoint/Joinpoint.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/metadata/MetaDataResolver.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/metadata/SimpleMetaData.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/util/MarshalledValue.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/util/PayloadKey.java
Log:
[JBAOP-498] Created a task to generate a public api documentation (where only the classes that users should know about are present), and added comments to some classes.

Modified: projects/aop/trunk/aop/build.xml
===================================================================
--- projects/aop/trunk/aop/build.xml	2007-12-31 01:54:21 UTC (rev 68584)
+++ projects/aop/trunk/aop/build.xml	2008-01-02 03:37:28 UTC (rev 68585)
@@ -513,4 +513,108 @@
       </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/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"/>
+         
+         <link href="http://java.sun.com/j2se/1.5.0/docs/api/"/>
+      </javadoc>
+   </target>
+
 </project>

Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/AdviceType.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/AdviceType.java	2007-12-31 01:54:21 UTC (rev 68584)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/AdviceType.java	2008-01-02 03:37:28 UTC (rev 68585)
@@ -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/trunk/aop/src/main/org/jboss/aop/Advised.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/Advised.java	2007-12-31 01:54:21 UTC (rev 68584)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/Advised.java	2008-01-02 03:37:28 UTC (rev 68585)
@@ -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/trunk/aop/src/main/org/jboss/aop/GeneratedAdvised.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/GeneratedAdvised.java	2007-12-31 01:54:21 UTC (rev 68584)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/GeneratedAdvised.java	2008-01-02 03:37:28 UTC (rev 68585)
@@ -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/trunk/aop/src/main/org/jboss/aop/InstanceAdvised.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/InstanceAdvised.java	2007-12-31 01:54:21 UTC (rev 68584)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/InstanceAdvised.java	2008-01-02 03:37:28 UTC (rev 68585)
@@ -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/trunk/aop/src/main/org/jboss/aop/InstanceAdvisor.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/InstanceAdvisor.java	2007-12-31 01:54:21 UTC (rev 68584)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/InstanceAdvisor.java	2008-01-02 03:37:28 UTC (rev 68585)
@@ -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/trunk/aop/src/main/org/jboss/aop/advice/AdviceType.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/advice/AdviceType.java	2007-12-31 01:54:21 UTC (rev 68584)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/advice/AdviceType.java	2008-01-02 03:37:28 UTC (rev 68585)
@@ -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/trunk/aop/src/main/org/jboss/aop/advice/AspectDefinition.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/advice/AspectDefinition.java	2007-12-31 01:54:21 UTC (rev 68584)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/advice/AspectDefinition.java	2008-01-02 03:37:28 UTC (rev 68585)
@@ -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/trunk/aop/src/main/org/jboss/aop/advice/AspectFactory.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/advice/AspectFactory.java	2007-12-31 01:54:21 UTC (rev 68584)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/advice/AspectFactory.java	2008-01-02 03:37:28 UTC (rev 68585)
@@ -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/trunk/aop/src/main/org/jboss/aop/advice/Interceptor.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/advice/Interceptor.java	2007-12-31 01:54:21 UTC (rev 68584)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/advice/Interceptor.java	2008-01-02 03:37:28 UTC (rev 68585)
@@ -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/trunk/aop/src/main/org/jboss/aop/advice/Scope.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/advice/Scope.java	2007-12-31 01:54:21 UTC (rev 68584)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/advice/Scope.java	2008-01-02 03:37:28 UTC (rev 68585)
@@ -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/trunk/aop/src/main/org/jboss/aop/joinpoint/Joinpoint.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/joinpoint/Joinpoint.java	2007-12-31 01:54:21 UTC (rev 68584)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/joinpoint/Joinpoint.java	2008-01-02 03:37:28 UTC (rev 68585)
@@ -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/trunk/aop/src/main/org/jboss/aop/metadata/MetaDataResolver.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/metadata/MetaDataResolver.java	2007-12-31 01:54:21 UTC (rev 68584)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/metadata/MetaDataResolver.java	2008-01-02 03:37:28 UTC (rev 68585)
@@ -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/trunk/aop/src/main/org/jboss/aop/metadata/SimpleMetaData.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/metadata/SimpleMetaData.java	2007-12-31 01:54:21 UTC (rev 68584)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/metadata/SimpleMetaData.java	2008-01-02 03:37:28 UTC (rev 68585)
@@ -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/trunk/aop/src/main/org/jboss/aop/util/MarshalledValue.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/util/MarshalledValue.java	2007-12-31 01:54:21 UTC (rev 68584)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/util/MarshalledValue.java	2008-01-02 03:37:28 UTC (rev 68585)
@@ -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/trunk/aop/src/main/org/jboss/aop/util/PayloadKey.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/util/PayloadKey.java	2007-12-31 01:54:21 UTC (rev 68584)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/util/PayloadKey.java	2008-01-02 03:37:28 UTC (rev 68585)
@@ -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




More information about the jboss-cvs-commits mailing list