geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r688818 - in /geronimo/server/trunk/plugins: corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/ corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/transaction/nodistributedtransactions/ openejb/geronimo-openejb/src/main...
Date Mon, 25 Aug 2008 18:31:00 GMT
Author: gawor
Date: Mon Aug 25 11:31:00 2008
New Revision: 688818

URL: http://svn.apache.org/viewvc?rev=688818&view=rev
Log:
more updates to get things going with latest openejb api

Modified:
    geronimo/server/trunk/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/TSSLink.java
    geronimo/server/trunk/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/transaction/nodistributedtransactions/NoDTxServerTransactionPolicies.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java

Modified: geronimo/server/trunk/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/TSSLink.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/TSSLink.java?rev=688818&r1=688817&r2=688818&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/TSSLink.java
(original)
+++ geronimo/server/trunk/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/TSSLink.java
Mon Aug 25 11:31:00 2008
@@ -33,6 +33,7 @@
 import org.apache.geronimo.corba.transaction.nodistributedtransactions.NoDTxServerTransactionPolicies;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.openejb.EjbDeployment;
+import org.apache.openejb.core.transaction.TransactionType;
 
 import org.omg.CORBA.Policy;
 
@@ -129,8 +130,8 @@
             String operation = (String) entry.getValue();
 
             if (!ejb.isBeanManagedTransaction()) {
-                byte transactionAttribute = ejb.getTransactionAttribute(method);
-                OperationTxPolicy operationTxPolicy = NoDTxServerTransactionPolicies.getContainerTransactionPolicy(transactionAttribute);
+            	TransactionType transactionType = ejb.getTransactionType(method);
+                OperationTxPolicy operationTxPolicy = NoDTxServerTransactionPolicies.getContainerTransactionPolicy(transactionType);
                 policies.put(operation, operationTxPolicy);
             } else {
                 OperationTxPolicy operationTxPolicy = NoDTxServerTransactionPolicies.getBeanTransactionPolicy();

Modified: geronimo/server/trunk/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/transaction/nodistributedtransactions/NoDTxServerTransactionPolicies.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/transaction/nodistributedtransactions/NoDTxServerTransactionPolicies.java?rev=688818&r1=688817&r2=688818&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/transaction/nodistributedtransactions/NoDTxServerTransactionPolicies.java
(original)
+++ geronimo/server/trunk/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/transaction/nodistributedtransactions/NoDTxServerTransactionPolicies.java
Mon Aug 25 11:31:00 2008
@@ -16,26 +16,30 @@
  */
 package org.apache.geronimo.corba.transaction.nodistributedtransactions;
 
+import java.util.HashMap;
+import java.util.Map;
+
 import org.apache.geronimo.corba.transaction.OperationTxPolicy;
-import org.apache.openejb.DeploymentInfo;
+import org.apache.openejb.core.transaction.TransactionType;
 
 /**
  * @version $Rev: 451417 $ $Date: 2006-09-29 13:13:22 -0700 (Fri, 29 Sep 2006) $
  */
 public class NoDTxServerTransactionPolicies {
-    private static final OperationTxPolicy[] policies = new OperationTxPolicy[DeploymentInfo.TX_MAX
+ 1];
-    static {
-        policies[DeploymentInfo.TX_MANDITORY] = Required.INSTANCE;
-        policies[DeploymentInfo.TX_NEVER] = NotRequired.INSTANCE;
-        policies[DeploymentInfo.TX_NOT_SUPPORTED] = Ignore.INSTANCE;
-        policies[DeploymentInfo.TX_REQUIRED] = NotRequired.INSTANCE;
-        policies[DeploymentInfo.TX_REQUIRES_NEW] = Ignore.INSTANCE;
-        policies[DeploymentInfo.TX_SUPPORTS] = NotRequired.INSTANCE;
+	private static final Map<TransactionType, OperationTxPolicy> policies = new HashMap<TransactionType,
OperationTxPolicy>();
+    static {    	
+        policies.put(TransactionType.Mandatory, Required.INSTANCE);        
+        policies.put(TransactionType.Never, NotRequired.INSTANCE);        
+        policies.put(TransactionType.NotSupported, Ignore.INSTANCE);        
+        policies.put(TransactionType.Required, NotRequired.INSTANCE);        
+        policies.put(TransactionType.RequiresNew, Ignore.INSTANCE);        
+        policies.put(TransactionType.Supports, NotRequired.INSTANCE);
     }
 
-    public static OperationTxPolicy getContainerTransactionPolicy(byte transactionAttribute)
{
-        return policies[transactionAttribute];
+    public static OperationTxPolicy getContainerTransactionPolicy(TransactionType transactionType)
{
+        return policies.get(transactionType);
     }
+    
     public static OperationTxPolicy getBeanTransactionPolicy() {
         return Ignore.INSTANCE;
     }

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java?rev=688818&r1=688817&r2=688818&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java
Mon Aug 25 11:31:00 2008
@@ -35,6 +35,7 @@
 import org.apache.openejb.InterfaceType;
 import org.apache.openejb.core.CoreDeploymentInfo;
 import org.apache.openejb.core.ivm.EjbObjectProxyHandler;
+import org.apache.openejb.core.transaction.TransactionType;
 
 public class EjbDeployment implements EJB, EjbDeploymentIdAccessor {
     private final String objectName;
@@ -249,6 +250,10 @@
         return deploymentInfo.isBeanManagedTransaction();
     }
 
+    public TransactionType getTransactionType(Method method) {
+          return deploymentInfo.getTransactionType(method);
+    }
+    
     public String getObjectName() {
         return objectName;
     }



Mime
View raw message