[jboss-cvs] JBossAS SVN: r67467 - in trunk/ejb3: src/main/org/jboss/ejb3 and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Nov 26 19:14:15 EST 2007


Author: scott.stark at jboss.org
Date: 2007-11-26 19:14:15 -0500 (Mon, 26 Nov 2007)
New Revision: 67467

Modified:
   trunk/ejb3/.classpath
   trunk/ejb3/src/main/org/jboss/ejb3/Ejb3DescriptorHandler.java
Log:
Change to use the spec TransactionAttributeType enum in the metadata

Modified: trunk/ejb3/.classpath
===================================================================
--- trunk/ejb3/.classpath	2007-11-27 00:09:14 UTC (rev 67466)
+++ trunk/ejb3/.classpath	2007-11-27 00:14:15 UTC (rev 67467)
@@ -2,7 +2,6 @@
 <classpath>
 	<classpathentry kind="src" path="src/main"/>
 	<classpathentry excluding="org/jboss/ejb3/test/**/*EmbeddedTest.java|org/jboss/ejb3/test/clusteredentity/unit/|org/jboss/ejb3/test/clusteredservice/unit/|org/jboss/ejb3/test/clusteredsession/unit/|org/jboss/ejb3/test/ejbthree921/unit/" kind="src" path="src/test"/>
-	<!--classpathentry kind="lib" path="src/resources/test"/-->
 	<classpathentry kind="lib" path="/thirdparty/trove/lib/trove.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/common-core/lib/jboss-common-core.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/common-logging-spi/lib/jboss-logging-spi.jar"/>
@@ -68,10 +67,6 @@
 	</classpathentry>
 	<classpathentry kind="lib" path="/thirdparty/jboss/jboss-ejb3-ext-api/lib/jboss-ejb3-ext-api.jar" sourcepath="/thirdparty/jboss/jboss-ejb3-ext-api/lib/jboss-ejb3-ext-api-sources.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/ha/lib/jboss-ha-client.jar" sourcepath="/thirdparty/jboss/ha/lib/jboss-ha-client-sources.jar"/>
-	<classpathentry kind="lib" path="/thirdparty/jboss/jboss-ejb3-cache/lib/jboss-ejb3-cache.jar" sourcepath="/thirdparty/jboss/jboss-ejb3-cache/lib/jboss-ejb3-cache-sources.jar">
-		<attributes>
-			<attribute name="javadoc_location" value="jar:platform:/resource/thirdparty/jboss/jboss-ejb3-cache/lib/jboss-ejb3-cache-javadoc.jar!/"/>
-		</attributes>
-	</classpathentry>
+	<classpathentry kind="lib" path="/thirdparty/jboss/jboss-ejb3-cache/lib/jboss-ejb3-cache.jar" sourcepath="/thirdparty/jboss/jboss-ejb3-cache/lib/jboss-ejb3-cache-sources.jar"/>
 	<classpathentry kind="output" path="output/eclipse-classes"/>
 </classpath>

Modified: trunk/ejb3/src/main/org/jboss/ejb3/Ejb3DescriptorHandler.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/Ejb3DescriptorHandler.java	2007-11-27 00:09:14 UTC (rev 67466)
+++ trunk/ejb3/src/main/org/jboss/ejb3/Ejb3DescriptorHandler.java	2007-11-27 00:14:15 UTC (rev 67467)
@@ -195,8 +195,6 @@
 import org.jboss.metadata.ejb.spec.SecurityIdentityMetaData;
 import org.jboss.metadata.ejb.spec.SessionBeanMetaData;
 import org.jboss.metadata.ejb.spec.SubscriptionDurability;
-import org.jboss.metadata.ejb.spec.TransAttributeType;
-import org.jboss.metadata.ejb.spec.TransactionType;
 import org.jboss.metadata.javaee.jboss.AnnotationMetaData;
 import org.jboss.metadata.javaee.jboss.AnnotationPropertiesMetaData;
 import org.jboss.metadata.javaee.jboss.AnnotationPropertyMetaData;
@@ -1103,11 +1101,11 @@
    {
       if (enterpriseBean != null)
       {
-         TransactionType transactionType = enterpriseBean.getTransactionType();
+         TransactionManagementType transactionType = enterpriseBean.getTransactionType();
          if (transactionType != null)
          {
             TransactionManagementImpl annotation = new TransactionManagementImpl();
-            annotation.setValue(toSpec(transactionType));
+            annotation.setValue(transactionType);
             addClassAnnotation(container, TransactionManagement.class, annotation);
          }
 
@@ -1132,7 +1130,7 @@
                if (method.getEjbName().equals(ejbName))
                {
                   TransactionAttributeImpl annotation = new TransactionAttributeImpl();
-                  annotation.setType(toSpec(transaction.getTransAttribute()));
+                  annotation.setType(transaction.getTransAttribute());
                   addAnnotations(TransactionAttribute.class, annotation, container, method);
                }
             }
@@ -2183,38 +2181,5 @@
       
       return false;
    }
-   
-   private TransactionAttributeType toSpec(TransAttributeType transactionAttributeType)
-   {
-      switch(transactionAttributeType)
-      {
-         case Mandatory:
-            return TransactionAttributeType.MANDATORY;
-         case Never:
-            return TransactionAttributeType.NEVER;
-         case NotSupported:
-            return TransactionAttributeType.NOT_SUPPORTED;
-         case Required:
-            return TransactionAttributeType.REQUIRED;
-         case RequiresNew:
-            return TransactionAttributeType.REQUIRES_NEW;
-         case Supports:
-            return TransactionAttributeType.SUPPORTS;
-         default:
-            throw new IllegalArgumentException("unknown transaction attribute type " + transactionAttributeType);
-      }
-   }
-   
-   private TransactionManagementType toSpec(TransactionType transactionType)
-   {
-      switch(transactionType)
-      {
-         case Bean:
-            return TransactionManagementType.BEAN;
-         case Container:
-            return TransactionManagementType.CONTAINER;
-         default:
-            throw new IllegalArgumentException("unknown transaction type " + transactionType);
-      }
-   }
+
 }




More information about the jboss-cvs-commits mailing list