[jboss-cvs] JBossAS SVN: r64886 - projects/aop/trunk/aop/src/main/org/jboss/aop/advice.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Aug 27 00:50:09 EDT 2007
Author: flavia.rainone at jboss.com
Date: 2007-08-27 00:50:09 -0400 (Mon, 27 Aug 2007)
New Revision: 64886
Modified:
projects/aop/trunk/aop/src/main/org/jboss/aop/advice/InvalidAdviceException.java
projects/aop/trunk/aop/src/main/org/jboss/aop/advice/NoMatchingAdviceException.java
Log:
[JBAOP-387] Commented exception classes.
Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/advice/InvalidAdviceException.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/advice/InvalidAdviceException.java 2007-08-27 04:33:47 UTC (rev 64885)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/advice/InvalidAdviceException.java 2007-08-27 04:50:09 UTC (rev 64886)
@@ -22,15 +22,28 @@
package org.jboss.aop.advice;
/**
- * @author <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
- *
+ * Exception thrown when an advice method does not comply with one or more rules
+ * regardless of the joinpoint to be intercepted.
+ * <p>
+ * If your application is throwing this exception, the solution is to fix the
+ * advice method so that it follows the required rule.
+ *
+ * @author Flavia Rainone
*/
public class InvalidAdviceException extends RuntimeException
{
private static final long serialVersionUID = -7761721818447236098L;
+ /**
+ * Constructor.
+ * <p>
+ * @param message a message describing why the advice method is considered
+ * invalid. Message should specify clearly the rule that is broken,
+ * the advice method that is invalid, and its type (if the rule
+ * depends on the type).
+ */
public InvalidAdviceException(String message)
{
super(message);
}
-}
+}
\ No newline at end of file
Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/advice/NoMatchingAdviceException.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/advice/NoMatchingAdviceException.java 2007-08-27 04:33:47 UTC (rev 64885)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/advice/NoMatchingAdviceException.java 2007-08-27 04:50:09 UTC (rev 64886)
@@ -22,13 +22,35 @@
package org.jboss.aop.advice;
/**
+ * Exception thrown when no advice suitable to intercept a specific joinpoint was
+ * found.
*
+ * This does not mean, however, that an advice is invalid or breaks a signature
+ * rule.
+ * <p>
+ * If your application is throwing this exception, you can either:
+ * <ul>
+ * <li> add a valid advice method if there is no advice method with the specified
+ * name;
+ * <li> change an existing advice method in order to make it suitable for the
+ * problematic joinpoint;</li>
+ * <li> add an overloaded advice method that is suitable for the problematic
+ * joinpoint.</li>
+ * </ul>
+ *
* @author <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
*/
public class NoMatchingAdviceException extends RuntimeException
{
private static final long serialVersionUID = 2170206416883695862L;
+ /**
+ * Constructor.
+ *
+ * @param adviceProperties properties of the queried advice
+ * @param adviceType the type of the queried advice
+ * @param message message explaining why no matching advice was found
+ */
public NoMatchingAdviceException(AdviceMethodProperties adviceProperties,
AdviceType adviceType, String message)
{
@@ -37,4 +59,17 @@
adviceProperties.getAspectClass().getName() + " for joinpoint " +
adviceProperties.getJoinPoint() + message);
}
+
+ /**
+ * Constructor.
+ *
+ * @param adviceProperties properties of the queried advice
+ * @param adviceType the type of the queried advice
+ * @param message message explaining why no matching advice was found
+ */
+ public NoMatchingAdviceException(Class aspectClass, String adviceName)
+ {
+ super("No matching advice called '" + adviceName + "' could be found in " +
+ aspectClass.getName() + ": method was not found");
+ }
}
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list