[jboss-cvs] JBossAS SVN: r95023 - branches/JBoss_AOP_1_5_5_GA_CP/aop/src/main/org/jboss/aop/annotation.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Oct 16 06:01:33 EDT 2009
Author: kabir.khan at jboss.com
Date: 2009-10-16 06:01:33 -0400 (Fri, 16 Oct 2009)
New Revision: 95023
Modified:
branches/JBoss_AOP_1_5_5_GA_CP/aop/src/main/org/jboss/aop/annotation/PortableAnnotationElement.java
Log:
[JBAOP-758] Don't read invisible annotations when shutting down server
Modified: branches/JBoss_AOP_1_5_5_GA_CP/aop/src/main/org/jboss/aop/annotation/PortableAnnotationElement.java
===================================================================
--- branches/JBoss_AOP_1_5_5_GA_CP/aop/src/main/org/jboss/aop/annotation/PortableAnnotationElement.java 2009-10-16 09:45:03 UTC (rev 95022)
+++ branches/JBoss_AOP_1_5_5_GA_CP/aop/src/main/org/jboss/aop/annotation/PortableAnnotationElement.java 2009-10-16 10:01:33 UTC (rev 95023)
@@ -48,15 +48,31 @@
*/
public class PortableAnnotationElement
{
+ private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
+
+ private static volatile boolean closingDownManager;
+
+ public static void setClosingDownManager(boolean closing)
+ {
+ closingDownManager = closing;
+ }
+
public static boolean isInvisibleAnnotationPresent(Field field, String annotation) throws Exception
{
+ if (closingDownManager)
+ {
+ return false;
+ }
CtField ctMethod = ReflectToJavassist.fieldToJavassist(field);
return AnnotationElement.isInvisibleAnnotationPresent(ctMethod, annotation);
-
}
public static boolean isInvisibleAnnotationPresent(CtField field, String annotation)
{
+ if (closingDownManager)
+ {
+ return false;
+ }
FieldInfo mi = field.getFieldInfo2();
AnnotationsAttribute invisible = (AnnotationsAttribute) mi.getAttribute(AnnotationsAttribute.invisibleTag);
@@ -67,6 +83,10 @@
public static boolean isVisibleAnnotationPresent(CtField field, String annotation)
{
+ if (closingDownManager)
+ {
+ return false;
+ }
FieldInfo mi = field.getFieldInfo2();
AnnotationsAttribute visible = (AnnotationsAttribute) mi.getAttribute(AnnotationsAttribute.visibleTag);
@@ -77,6 +97,10 @@
public static boolean isAnyAnnotationPresent(CtField ctField, String annotation)
{
+ if (closingDownManager)
+ {
+ return false;
+ }
FieldInfo mi = ctField.getFieldInfo2();
AnnotationsAttribute visible = (AnnotationsAttribute) mi.getAttribute(AnnotationsAttribute.visibleTag);
@@ -96,6 +120,10 @@
public static boolean isInvisibleAnnotationPresent(Method method, String annotation) throws Exception
{
+ if (closingDownManager)
+ {
+ return false;
+ }
CtMethod ctMethod = ReflectToJavassist.methodToJavassist(method);
if (ctMethod == null) return false;
MethodInfo mi = ctMethod.getMethodInfo2();
@@ -110,6 +138,10 @@
public static boolean isAnyAnnotationPresent(Field field, String annotation) throws Exception
{
+ if (closingDownManager)
+ {
+ return false;
+ }
CtField ctField = ReflectToJavassist.fieldToJavassist(field);
return AnnotationElement.isAnyAnnotationPresent(ctField, annotation);
@@ -117,6 +149,10 @@
public static boolean isAnyAnnotationPresent(Method method, String annotation) throws Exception
{
+ if (closingDownManager)
+ {
+ return false;
+ }
CtMethod ctMethod = ReflectToJavassist.methodToJavassist(method);
if (ctMethod == null) return false;
boolean present = AnnotationElement.isAnyAnnotationPresent(ctMethod, annotation);
@@ -126,6 +162,10 @@
public static boolean isAnyAnnotationPresent(CtMethod ctMethod, String annotation)
{
+ if (closingDownManager)
+ {
+ return false;
+ }
MethodInfo mi = ctMethod.getMethodInfo2();
AnnotationsAttribute visible = (AnnotationsAttribute) mi.getAttribute(AnnotationsAttribute.visibleTag);
@@ -145,14 +185,20 @@
public static boolean isInvisibleAnnotationPresent(Constructor con, String annotation) throws Exception
{
+ if (closingDownManager)
+ {
+ return false;
+ }
CtConstructor ctMethod = ReflectToJavassist.constructorToJavassist(con);
return AnnotationElement.isInvisibleAnnotationPresent(ctMethod, annotation);
-
-
}
public static boolean isInvisibleAnnotationPresent(CtConstructor ctMethod, String annotation)
{
+ if (closingDownManager)
+ {
+ return false;
+ }
MethodInfo mi = ctMethod.getMethodInfo2();
@@ -164,6 +210,10 @@
public static boolean isVisibleAnnotationPresent(CtConstructor ctMethod, String annotation)
{
+ if (closingDownManager)
+ {
+ return false;
+ }
MethodInfo mi = ctMethod.getMethodInfo2();
@@ -175,6 +225,10 @@
public static boolean isAnyAnnotationPresent(Constructor con, String annotation) throws Exception
{
+ if (closingDownManager)
+ {
+ return false;
+ }
CtConstructor ctMethod = ReflectToJavassist.constructorToJavassist(con);
return AnnotationElement.isAnyAnnotationPresent(ctMethod, annotation);
@@ -182,6 +236,10 @@
public static boolean isAnyAnnotationPresent(CtConstructor ctMethod, String annotation)
{
+ if (closingDownManager)
+ {
+ return false;
+ }
MethodInfo mi = ctMethod.getMethodInfo2();
AnnotationsAttribute visible = (AnnotationsAttribute) mi.getAttribute(AnnotationsAttribute.visibleTag);
@@ -201,6 +259,10 @@
public static boolean isInvisibleAnnotationPresent(Class clazz, String annotation) throws Exception
{
+ if (closingDownManager)
+ {
+ return false;
+ }
if (clazz == Void.TYPE) return false;
ClassFile cf = AnnotationElement.getClassFile(clazz);
@@ -212,6 +274,10 @@
public static boolean isAnyAnnotationPresent(CtClass clazz, String annotation) throws Exception
{
+ if (closingDownManager)
+ {
+ return false;
+ }
if (clazz == CtClass.voidType) return false;
ClassFile cf = clazz.getClassFile2();
AnnotationsAttribute visible = (AnnotationsAttribute) cf.getAttribute(AnnotationsAttribute.visibleTag);
@@ -231,6 +297,10 @@
public static boolean isAnyAnnotationPresent(Class clazz, String annotation) throws Exception
{
+ if (closingDownManager)
+ {
+ return false;
+ }
if (clazz == Void.TYPE) return false;
ClassFile cf = AnnotationElement.getClassFile(clazz);
AnnotationsAttribute visible = (AnnotationsAttribute) cf.getAttribute(AnnotationsAttribute.visibleTag);
@@ -266,6 +336,10 @@
public static Object getInvisibleAnnotation(Method method, Class annotation)
{
+ if (closingDownManager)
+ {
+ return null;
+ }
try
{
CtMethod ctMethod = ReflectToJavassist.methodToJavassist(method);
@@ -288,6 +362,10 @@
public static Object getInvisibleAnnotation(Constructor con, Class annotation)
{
+ if (closingDownManager)
+ {
+ return null;
+ }
try
{
CtConstructor ctMethod = ReflectToJavassist.constructorToJavassist(con);
@@ -307,6 +385,10 @@
public static Object getInvisibleAnnotation(Field field, Class annotation)
{
+ if (closingDownManager)
+ {
+ return null;
+ }
try
{
CtField ctField = ReflectToJavassist.fieldToJavassist(field);
@@ -326,6 +408,10 @@
public static Object getInvisibleAnnotation(Class clazz, Class annotation)
{
+ if (closingDownManager)
+ {
+ return null;
+ }
try
{
if (clazz == Void.TYPE) return null;
@@ -388,6 +474,11 @@
public static boolean isAnyAnnotationPresent(Field field, Class annotation) throws Exception
{
if (AnnotationElement.isVisibleAnnotationPresent(field, annotation)) return true;
+ if (closingDownManager)
+ {
+ return false;
+ }
+
CtField ctMethod = ReflectToJavassist.fieldToJavassist(field);
return isInvisibleAnnotationPresent(ctMethod, annotation.getName());
}
@@ -396,6 +487,11 @@
{
if (clazz == Void.TYPE) return false;
if (AnnotationElement.isVisibleAnnotationPresent(clazz, annotation)) return true;
+ if (closingDownManager)
+ {
+ return false;
+ }
+
ClassFile cf = getClassFile(clazz);
AnnotationsAttribute invisible = (AnnotationsAttribute) cf.getAttribute(AnnotationsAttribute.invisibleTag);
@@ -407,15 +503,21 @@
public static boolean isAnyAnnotationPresent(Constructor con, Class annotation) throws Exception
{
if (AnnotationElement.isVisibleAnnotationPresent(con, annotation)) return true;
+ if (closingDownManager)
+ {
+ return false;
+ }
CtConstructor ctMethod = ReflectToJavassist.constructorToJavassist(con);
return isVisibleAnnotationPresent(ctMethod, annotation.getName());
-
-
}
public static boolean isAnyAnnotationPresent(Method method, Class annotation) throws Exception
{
if (AnnotationElement.isVisibleAnnotationPresent(method, annotation)) return true;
+ if (closingDownManager)
+ {
+ return false;
+ }
CtMethod ctMethod = ReflectToJavassist.methodToJavassist(method);
if (ctMethod == null) return false;
MethodInfo mi = ctMethod.getMethodInfo2();
@@ -429,12 +531,20 @@
public static boolean isVisibleAnnotationPresent(Field field, String annotation) throws Exception
{
+ if (closingDownManager)
+ {
+ return false;
+ }
CtField ctMethod = ReflectToJavassist.fieldToJavassist(field);
return isVisibleAnnotationPresent(ctMethod, annotation);
}
public static boolean isVisibleAnnotationPresent(Class clazz, String annotation) throws Exception
{
+ if (closingDownManager)
+ {
+ return false;
+ }
if (clazz == Void.TYPE) return false;
ClassFile cf = getClassFile(clazz);
@@ -447,14 +557,20 @@
public static boolean isVisibleAnnotationPresent(Constructor con, String annotation) throws Exception
{
+ if (closingDownManager)
+ {
+ return false;
+ }
CtConstructor ctMethod = ReflectToJavassist.constructorToJavassist(con);
return isVisibleAnnotationPresent(ctMethod, annotation);
-
-
}
public static boolean isVisibleAnnotationPresent(Method method, String annotation) throws Exception
{
+ if (closingDownManager)
+ {
+ return false;
+ }
CtMethod ctMethod = ReflectToJavassist.methodToJavassist(method);
if (ctMethod == null) return false;
MethodInfo mi = ctMethod.getMethodInfo2();
More information about the jboss-cvs-commits
mailing list