|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2006 the original author or authors. |
|
|
|
* Copyright 2002-2009 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -67,13 +67,23 @@ public class AspectMetadata { |
|
|
|
* @param aspectClass the aspect class
|
|
|
|
* @param aspectClass the aspect class
|
|
|
|
* @param aspectName the name of the aspect |
|
|
|
* @param aspectName the name of the aspect |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public AspectMetadata(Class aspectClass, String aspectName) { |
|
|
|
public AspectMetadata(Class<?> aspectClass, String aspectName) { |
|
|
|
this.aspectName = aspectName; |
|
|
|
this.aspectName = aspectName; |
|
|
|
this.ajType = AjTypeSystem.getAjType(aspectClass); |
|
|
|
|
|
|
|
|
|
|
|
Class<?> currClass = aspectClass; |
|
|
|
if (!this.ajType.isAspect()) { |
|
|
|
AjType ajType = null; |
|
|
|
|
|
|
|
while (!currClass.equals(Object.class)) { |
|
|
|
|
|
|
|
AjType ajTypeToCheck = AjTypeSystem.getAjType(currClass); |
|
|
|
|
|
|
|
if (ajTypeToCheck.isAspect()) { |
|
|
|
|
|
|
|
ajType = ajTypeToCheck; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
currClass = currClass.getSuperclass(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (ajType == null) { |
|
|
|
throw new IllegalArgumentException("Class '" + aspectClass.getName() + "' is not an @AspectJ aspect"); |
|
|
|
throw new IllegalArgumentException("Class '" + aspectClass.getName() + "' is not an @AspectJ aspect"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.ajType = ajType; |
|
|
|
if (this.ajType.getDeclarePrecedence().length > 0) { |
|
|
|
if (this.ajType.getDeclarePrecedence().length > 0) { |
|
|
|
throw new IllegalArgumentException("DeclarePrecendence not presently supported in Spring AOP"); |
|
|
|
throw new IllegalArgumentException("DeclarePrecendence not presently supported in Spring AOP"); |
|
|
|
} |
|
|
|
} |
|
|
|
|