Author: richard.opalka(a)jboss.com
Date: 2009-04-03 16:41:38 -0400 (Fri, 03 Apr 2009)
New Revision: 9733
Modified:
common/trunk/src/main/java/org/jboss/wsf/common/javax/JavaxAnnotationHelper.java
Log:
[JBWS-2074] BC
Modified:
common/trunk/src/main/java/org/jboss/wsf/common/javax/JavaxAnnotationHelper.java
===================================================================
---
common/trunk/src/main/java/org/jboss/wsf/common/javax/JavaxAnnotationHelper.java 2009-04-03
20:01:23 UTC (rev 9732)
+++
common/trunk/src/main/java/org/jboss/wsf/common/javax/JavaxAnnotationHelper.java 2009-04-03
20:41:38 UTC (rev 9733)
@@ -83,6 +83,18 @@
Class<?> instanceClass = instance.getClass();
+ // TODO: remove this check once AS 42x support is removed
+ try
+ {
+
instanceClass.getClassLoader().loadClass("javax.annotation.Resource");
+ }
+ catch (Throwable th)
+ {
+ LOG.warn("Cannot inject resources: ", th);
+ return;
+ }
+ // TODO: end
+
InitialContext ctx = new InitialContext();
// inject descriptor driven annotations
@@ -200,6 +212,18 @@
if (instance == null)
throw new IllegalArgumentException("Object instance cannot be null");
+ // TODO: remove this check once AS 42x support is removed
+ try
+ {
+
instance.getClass().getClassLoader().loadClass("javax.annotation.PostConstruct");
+ }
+ catch (Throwable th)
+ {
+ LOG.warn("Cannot call post construct: ", th);
+ return;
+ }
+ // TODO: end
+
Collection<Method> methods =
POST_CONSTRUCT_METHOD_FINDER.process(instance.getClass());
if (methods.size() > 0)
@@ -230,6 +254,18 @@
if (instance == null)
throw new IllegalArgumentException("Object instance cannot be null");
+ // TODO: remove this check once AS 42x support is removed
+ try
+ {
+
instance.getClass().getClassLoader().loadClass("javax.annotation.PreDestroy");
+ }
+ catch (Throwable th)
+ {
+ LOG.warn("Cannot call pre destroy: ", th);
+ return;
+ }
+ // TODO: end
+
Collection<Method> methods =
PRE_DESTROY_METHOD_FINDER.process(instance.getClass());
if (methods.size() > 0)
Show replies by date