Author: peteroyle
Date: 2009-03-19 18:49:24 -0400 (Thu, 19 Mar 2009)
New Revision: 2115
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/EJBApiAbstraction.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/ApiAbstraction.java
Log:
Introduced dummy enum - used when lookup of PersistenceContextType fails
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/EJBApiAbstraction.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/EJBApiAbstraction.java 2009-03-19
18:38:11 UTC (rev 2114)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/EJBApiAbstraction.java 2009-03-19
22:49:24 UTC (rev 2115)
@@ -39,7 +39,11 @@
EJB_ANNOTATION_CLASS = annotationTypeForName("javax.ejb.EJB");
RESOURCE_ANNOTATION_CLASS =
annotationTypeForName("javax.annotation.Resource");
PERSISTENCE_CONTEXT_TYPE_CLASS =
classForName("javax.persistence.PersistenceContextType");
- EXTENDED_PERSISTENCE_CONTEXT_ENUM_VALUE = enumValue(PERSISTENCE_CONTEXT_TYPE_CLASS,
"EXTENDED");
+ if (PERSISTENCE_CONTEXT_TYPE_CLASS.getClass().equals( Dummy.class)) {
+ EXTENDED_PERSISTENCE_CONTEXT_ENUM_VALUE =
enumValue(PERSISTENCE_CONTEXT_TYPE_CLASS, "EXTENDED");
+ } else {
+ EXTENDED_PERSISTENCE_CONTEXT_ENUM_VALUE = DummyEnum.DUMMY_VALUE;
+ }
}
public final Class<?> PERSISTENCE_CONTEXT_TYPE_CLASS;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/ApiAbstraction.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/ApiAbstraction.java 2009-03-19
18:38:11 UTC (rev 2114)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/ApiAbstraction.java 2009-03-19
22:49:24 UTC (rev 2115)
@@ -50,9 +50,16 @@
public interface Dummy
{
}
-
/**
+ * "Not found" enumeration value.
+ */
+ public enum DummyEnum
+ {
+ DUMMY_VALUE
+ }
+
+ /**
* Constructor
*
* @param resourceLoader The root resource loaderS