You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by db...@apache.org on 2008/03/24 22:46:35 UTC

svn commit: r640593 - in /openejb/branches/openejb-3.0/container/openejb-core/src: main/java/org/apache/openejb/assembler/classic/ main/java/org/apache/openejb/core/entity/ main/java/org/apache/openejb/core/stateful/ main/java/org/apache/openejb/core/s...

Author: dblevins
Date: Mon Mar 24 14:46:31 2008
New Revision: 640593

URL: http://svn.apache.org/viewvc?rev=640593&view=rev
Log:
Merging r639524 - http://svn.apache.org/viewvc?rev=639524&view=rev

svn merge -r 639523:639524 https://svn.apache.org/repos/asf/openejb/trunk/openejb3 .

------------------------------------------------------------------------
r639524 | dblevins | 2008-03-20 19:45:48 -0700 (Thu, 20 Mar 2008) | 2 lines

Hopefully a fully functional tx attribute setup with tests.

------------------------------------------------------------------------

Added:
    openejb/branches/openejb-3.0/container/openejb-core/src/test/java/org/apache/openejb/core/stateful/StatefulTransactionAttributesTest.java
      - copied unchanged from r639524, openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/stateful/StatefulTransactionAttributesTest.java
Modified:
    openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanBuilder.java
    openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/InterceptorBuilder.java
    openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodInfoUtil.java
    openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodTransactionBuilder.java
    openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityContainer.java
    openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulBeanManagedTxPolicy.java
    openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessBeanManagedTxPolicy.java
    openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxMandatory.java
    openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxNever.java
    openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxNotSupported.java
    openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxRequired.java
    openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxRequiresNew.java
    openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxSupports.java

Modified: openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanBuilder.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanBuilder.java?rev=640593&r1=640592&r2=640593&view=diff
==============================================================================
--- openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanBuilder.java (original)
+++ openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanBuilder.java Mon Mar 24 14:46:31 2008
@@ -335,7 +335,7 @@
         }
 
         try {
-            method = clazz.getDeclaredMethod(info.methodName, parameterTypes.toArray(new Class[parameterTypes.size()]));
+            method = clazz.getMethod(info.methodName, parameterTypes.toArray(new Class[parameterTypes.size()]));
         } catch (NoSuchMethodException e) {
             throw new IllegalStateException("Callback method does not exist: " + clazz.getName() + "." + info.methodName, e);
         }

Modified: openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/InterceptorBuilder.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/InterceptorBuilder.java?rev=640593&r1=640592&r2=640593&view=diff
==============================================================================
--- openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/InterceptorBuilder.java (original)
+++ openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/InterceptorBuilder.java Mon Mar 24 14:46:31 2008
@@ -45,7 +45,7 @@
 
         // check for a method level interceptor
         for (MethodInterceptorInfo methodInterceptorInfo : methodInterceptors) {
-            if (matches(method, methodInterceptorInfo.methodInfo)) {
+            if (MethodInfoUtil.matches(method, methodInterceptorInfo.methodInfo)) {
                 if (!methodInterceptorInfo.excludeDefaultInterceptors) {
                     for (InterceptorData interceptorData : defaultInterceptors) {
                         interceptors.add(interceptorData);
@@ -85,43 +85,6 @@
 //            interceptorDatas.add(new InterceptorData(interceptorInfo.clazz, interceptorInfo.methodName));
 //        }
         return interceptorDatas;
-    }
-
-    private static boolean matches(Method method, MethodInfo methodInfo) throws SecurityException {
-        if (methodInfo.methodName.equals(method.getName())) {
-            return false;
-        }
-
-        // do we have parameters?
-        List<String> methodParams = methodInfo.methodParams;
-        if (methodParams == null) {
-            return true;
-        }
-
-        // do we have the same number of parameters?
-        if (methodParams.size() != method.getParameterTypes().length) {
-            return false;
-        }
-
-        // match parameters names
-        Class<?>[] parameterTypes = method.getParameterTypes();
-        for (int i = 0; i < parameterTypes.length; i++) {
-            Class<?> parameterType = parameterTypes[i];
-            String methodParam = methodParams.get(i);
-            if (methodParam.equals(getName(parameterType))) {
-                return false;
-            }
-        }
-
-        return false;
-    }
-
-    private static String getName(Class<?> type) {
-        if (type.isArray()) {
-            return getName(type.getComponentType()) + "[]";
-        } else {
-            return type.getName();
-        }
     }
 
     public static final MethodInterceptorInfoComparator METHOD_INTERCEPTOR_INFO_COMPARATOR = new MethodInterceptorInfoComparator();

Modified: openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodInfoUtil.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodInfoUtil.java?rev=640593&r1=640592&r2=640593&view=diff
==============================================================================
--- openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodInfoUtil.java (original)
+++ openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodInfoUtil.java Mon Mar 24 14:46:31 2008
@@ -24,7 +24,7 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Map;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.lang.reflect.Method;
 
 /**
@@ -32,27 +32,74 @@
  */
 public class MethodInfoUtil {
 
+    public static List<Method> matchingMethods(Method signature, Class clazz) {
+        List<Method> list = new ArrayList<Method>();
+        METHOD: for (Method method : clazz.getMethods()) {
+            if (!method.getName().equals(signature.getName())) continue;
+
+            Class<?>[] methodTypes = method.getParameterTypes();
+            Class<?>[] signatureTypes = signature.getParameterTypes();
+
+            if (methodTypes.length != signatureTypes.length) continue;
+
+            for (int i = 0; i < methodTypes.length; i++) {
+                if (!methodTypes[i].equals(signatureTypes[i])) continue METHOD;
+            }
+            list.add(method);
+        }
+        return list;
+    }
+
     public static List<Method> matchingMethods(MethodInfo mi, Class clazz) {
+        Method[] methods = clazz.getMethods();
+
+        return matchingMethods(mi, methods);
+    }
+
+    public static List<Method> matchingMethods(MethodInfo mi, Method[] methods) {
+
+        List<Method> filtered = filterByLevel(mi, methods);
+
+        filtered = filterByView(mi, filtered);
+
+        return filtered;
+    }
+
+    private static List<Method> filterByView(MethodInfo mi, List<Method> filtered) {
+        View view = view(mi);
+        switch(view){
+            case CLASS:{
+                return filterByClass(mi, filtered);
+            }
+        }
+
+        return filtered;
+    }
+
+    private static List<Method> filterByClass(MethodInfo mi, List<Method> methods) {
+        ArrayList<Method> list = new ArrayList<Method>();
+        for (Method method : methods) {
+            String className = method.getDeclaringClass().getName();
+            if (mi.className.equals(className)){
+                list.add(method);
+            }
+        }
+        return list;
+    }
 
+    private static List<Method> filterByLevel(MethodInfo mi, Method[] methods) {
         Level level = level(mi);
 
         switch(level){
             case BEAN:
             case PACKAGE: {
-                return asList(clazz.getMethods());
+                return asList(methods);
             }
-            case CLASS: {
-                return filterByClass(clazz.getMethods(), mi.className);
-            }
-            case OVERLOADED_METHOD_BEAN:{
-                return filterByName(clazz.getMethods(), mi.methodName);
-            }
-            case OVERLOADED_METHOD_CLASS:{
-                return filterByNameAndClass(clazz.getMethods(), mi.className, mi.methodName);
+            case OVERLOADED_METHOD:{
+                return filterByName(methods, mi.methodName);
             }
             case EXACT_METHOD:{
-                Method method = getMethod(clazz, mi);
-                if (method != null) return asList(method);
+                return filterByNameAndParams(methods, mi);
             }
         }
 
@@ -84,16 +131,6 @@
         return method;
     }
 
-    private static List<Method> filterByClass(Method[] methods, String className) {
-        List<Method> list = new ArrayList<Method>();
-        for (Method method : methods) {
-            if (method.getDeclaringClass().getName().equals(className)){
-                list.add(method);
-            }
-        }
-        return list;
-    }
-
     private static List<Method> filterByName(Method[] methods, String methodName) {
         List<Method> list = new ArrayList<Method>();
         for (Method method : methods) {
@@ -104,10 +141,10 @@
         return list;
     }
 
-    private static List<Method> filterByNameAndClass(Method[] methods, String className, String methodName) {
+    private static List<Method> filterByNameAndParams(Method[] methods, MethodInfo mi) {
         List<Method> list = new ArrayList<Method>();
         for (Method method : methods) {
-            if (method.getName().equals(methodName) && method.getDeclaringClass().getName().equals(className) ){
+            if (matches(method, mi)){
                 list.add(method);
             }
         }
@@ -144,24 +181,7 @@
         return normalized;
     }
 
-    public static Level level(MethodInfo methodInfo) {
-        if (methodInfo.ejbName.equals("*")) return Level.PACKAGE;
-        if (methodInfo.methodName.equals("*")) {
-            if (methodInfo.className.equals("*")) return Level.BEAN;
-            else return Level.CLASS;
-        }
-        if (methodInfo.methodParams == null){
-            if (methodInfo.className.equals("*")) return Level.OVERLOADED_METHOD_BEAN;
-            else return Level.OVERLOADED_METHOD_CLASS;
-        }
-        return Level.EXACT_METHOD;
-    }
-
-
     private static Class getClassForParam(String className, ClassLoader cl) throws ClassNotFoundException {
-        if (cl == null) {
-            cl = ClassLoader.getSystemClassLoader();
-        }
 
         if (className.equals("int")) {
             return Integer.TYPE;
@@ -180,76 +200,50 @@
         } else if (className.equals("byte")) {
             return Byte.TYPE;
         } else
-            return cl.loadClass(className);
+            return Class.forName(className, false, cl);
 
     }
 
     public static Map<Method, MethodAttributeInfo> resolveAttributes(List<? extends MethodAttributeInfo> infos, CoreDeploymentInfo deploymentInfo) {
-        Map<Method, MethodAttributeInfo> attributes = new HashMap<Method, MethodAttributeInfo>();
+        Map<Method, MethodAttributeInfo> attributes = new LinkedHashMap<Method, MethodAttributeInfo>();
+
+        Method[] wildCardView = getWildCardView(deploymentInfo).toArray(new Method[]{});
 
         for (MethodAttributeInfo attributeInfo : infos) {
             for (MethodInfo methodInfo : attributeInfo.methods) {
 
-                if (methodInfo.ejbDeploymentId == null || methodInfo.ejbDeploymentId.equals(deploymentInfo.getDeploymentID())) {
-                    if (!deploymentInfo.isBeanManagedTransaction()) {
-
-                        List<Method> methods = new ArrayList<Method>();
-
-                        if (methodInfo.methodIntf == null) {
+                if (methodInfo.ejbName == null || methodInfo.ejbName.equals("*") || methodInfo.ejbName.equals(deploymentInfo.getEjbName())) {
 
-                            methods.addAll(matchingMethods(methodInfo, deploymentInfo.getBeanClass()));
+                    List<Method> methods = new ArrayList<Method>();
 
-                            if (deploymentInfo.getRemoteInterface() != null) {
-                                methods.addAll(matchingMethods(methodInfo, deploymentInfo.getRemoteInterface()));
-                            }
-                            if (deploymentInfo.getHomeInterface() != null) {
-                                methods.addAll(matchingMethods(methodInfo, deploymentInfo.getHomeInterface()));
-                            }
-                            if (deploymentInfo.getLocalInterface() != null) {
-                                methods.addAll(matchingMethods(methodInfo, deploymentInfo.getLocalInterface()));
-                            }
-                            if (deploymentInfo.getLocalHomeInterface() != null) {
-                                methods.addAll(matchingMethods(methodInfo, deploymentInfo.getLocalHomeInterface()));
-                            }
-                            if(deploymentInfo.getMdbInterface() != null) {
-                                methods.addAll(matchingMethods(methodInfo, deploymentInfo.getMdbInterface()));
-                            }
-                            if(deploymentInfo.getServiceEndpointInterface() != null) {
-                                methods.addAll(matchingMethods(methodInfo, deploymentInfo.getServiceEndpointInterface()));
-                            }
-                            for (Class intf : deploymentInfo.getBusinessRemoteInterfaces()) {
-                                methods.addAll(matchingMethods(methodInfo, intf));
-                            }
-                            for (Class intf : deploymentInfo.getBusinessLocalInterfaces()) {
-                                methods.addAll(matchingMethods(methodInfo, intf));
-                            }
-                        } else if (methodInfo.methodIntf.equals("Home")) {
-                            methods.addAll(matchingMethods(methodInfo, deploymentInfo.getHomeInterface()));
-                        } else if (methodInfo.methodIntf.equals("Remote")) {
-                            methods.addAll(matchingMethods(methodInfo, deploymentInfo.getRemoteInterface()));
-                            for (Class intf : deploymentInfo.getBusinessRemoteInterfaces()) {
-                                methods.addAll(matchingMethods(methodInfo, intf));
-                            }
-                        } else if (methodInfo.methodIntf.equals("LocalHome")) {
-                            methods.addAll(matchingMethods(methodInfo, deploymentInfo.getLocalHomeInterface()));
-                        } else if (methodInfo.methodIntf.equals("Local")) {
-                            methods.addAll(matchingMethods(methodInfo, deploymentInfo.getLocalInterface()));
-                            for (Class intf : deploymentInfo.getBusinessRemoteInterfaces()) {
-                                methods.addAll(matchingMethods(methodInfo, intf));
-                            }
-                        } else if (methodInfo.methodIntf.equals("ServiceEndpoint")) {
-                            methods.addAll(matchingMethods(methodInfo, deploymentInfo.getServiceEndpointInterface()));
+                    if (methodInfo.methodIntf == null) {
+                        methods.addAll(matchingMethods(methodInfo, wildCardView));
+                    } else if (methodInfo.methodIntf.equals("Home")) {
+                        methods.addAll(matchingMethods(methodInfo, deploymentInfo.getHomeInterface()));
+                    } else if (methodInfo.methodIntf.equals("Remote")) {
+                        methods.addAll(matchingMethods(methodInfo, deploymentInfo.getRemoteInterface()));
+                        for (Class intf : deploymentInfo.getBusinessRemoteInterfaces()) {
+                            methods.addAll(matchingMethods(methodInfo, intf));
                         }
+                    } else if (methodInfo.methodIntf.equals("LocalHome")) {
+                        methods.addAll(matchingMethods(methodInfo, deploymentInfo.getLocalHomeInterface()));
+                    } else if (methodInfo.methodIntf.equals("Local")) {
+                        methods.addAll(matchingMethods(methodInfo, deploymentInfo.getLocalInterface()));
+                        for (Class intf : deploymentInfo.getBusinessRemoteInterfaces()) {
+                            methods.addAll(matchingMethods(methodInfo, intf));
+                        }
+                    } else if (methodInfo.methodIntf.equals("ServiceEndpoint")) {
+                        methods.addAll(matchingMethods(methodInfo, deploymentInfo.getServiceEndpointInterface()));
+                    }
 
-                        for (Method method : methods) {
-                            if ((method.getDeclaringClass() == javax.ejb.EJBObject.class ||
-                                    method.getDeclaringClass() == javax.ejb.EJBHome.class) &&
-                                    !method.getName().equals("remove")) {
-                                continue;
-                            }
-
-                            attributes.put(method, attributeInfo);
+                    for (Method method : methods) {
+                        if ((method.getDeclaringClass() == javax.ejb.EJBObject.class ||
+                                method.getDeclaringClass() == javax.ejb.EJBHome.class) &&
+                                !method.getName().equals("remove")) {
+                            continue;
                         }
+
+                        attributes.put(method, attributeInfo);
                     }
                 }
             }
@@ -257,10 +251,138 @@
         return attributes;
     }
 
+    private static List<Method> getWildCardView(CoreDeploymentInfo info) {
+        List<Method> methods = new ArrayList<Method>();
+
+        List<Method> beanMethods = asList(info.getBeanClass().getMethods());
+        methods.addAll(beanMethods);
+
+        if (info.getRemoteInterface() != null) {
+            methods.addAll(exclude(beanMethods, info.getRemoteInterface().getMethods()));
+        }
+        if (info.getHomeInterface() != null) {
+            methods.addAll(exclude(beanMethods, info.getHomeInterface().getMethods()));
+        }
+        if (info.getLocalInterface() != null) {
+            methods.addAll(exclude(beanMethods, info.getLocalInterface().getMethods()));
+        }
+        if (info.getLocalHomeInterface() != null) {
+            methods.addAll(exclude(beanMethods, info.getLocalHomeInterface().getMethods()));
+        }
+        if(info.getMdbInterface() != null) {
+            methods.addAll(exclude(beanMethods, info.getMdbInterface().getMethods()));
+        }
+        if(info.getServiceEndpointInterface() != null) {
+            methods.addAll(exclude(beanMethods, info.getServiceEndpointInterface().getMethods()));
+        }
+        for (Class intf : info.getBusinessRemoteInterfaces()) {
+            methods.addAll(exclude(beanMethods, intf.getMethods()));
+        }
+        for (Class intf : info.getBusinessLocalInterfaces()) {
+            methods.addAll(exclude(beanMethods, intf.getMethods()));
+        }
+
+
+        return methods;
+    }
+
+    private static List<Method> exclude(List<Method> excludes, Method[] methods) {
+        ArrayList<Method> list = new ArrayList<Method>();
+
+        for (Method method : methods) {
+            if (!matches(excludes, method)){
+                list.add(method);
+            }
+        }
+        return list;
+    }
+
+    private static boolean matches(List<Method> excludes, Method method) {
+        for (Method excluded : excludes) {
+            boolean match = match(method, excluded);
+            if (match){
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public static boolean match(Method methodA, Method methodB) {
+        if (!methodA.getName().equals(methodB.getName())) return false;
+
+        if (methodA.getParameterTypes().length != methodB.getParameterTypes().length){
+            return false;
+        }
+
+        for (int i = 0; i < methodA.getParameterTypes().length; i++) {
+            Class<?> a = methodA.getParameterTypes()[i];
+            Class<?> b = methodB.getParameterTypes()[i];
+            if (!a.equals(b)) return false;
+        }
+        return true;
+    }
+
+    public static boolean matches(Method method, MethodInfo methodInfo) {
+
+        if (!methodInfo.methodName.equals(method.getName())) {
+            return false;
+        }
+
+        // do we have parameters?
+        List<String> methodParams = methodInfo.methodParams;
+        if (methodParams == null) {
+            return true;
+        }
+
+        // do we have the same number of parameters?
+        if (methodParams.size() != method.getParameterTypes().length) {
+            return false;
+        }
+
+        // match parameters names
+        Class<?>[] parameterTypes = method.getParameterTypes();
+        for (int i = 0; i < parameterTypes.length; i++) {
+            Class<?> parameterType = parameterTypes[i];
+            String methodParam = methodParams.get(i);
+            if (!methodParam.equals(getName(parameterType))) {
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    private static String getName(Class<?> type) {
+        if (type.isArray()) {
+            return getName(type.getComponentType()) + "[]";
+        } else {
+            return type.getName();
+        }
+    }
+
+
     public static enum Level {
-        PACKAGE, CLASS, BEAN, OVERLOADED_METHOD_CLASS, OVERLOADED_METHOD_BEAN, EXACT_METHOD
+        PACKAGE, BEAN, OVERLOADED_METHOD, EXACT_METHOD
+    }
+
+    public static enum View {
+        CLASS, ANY, INTERFACE;
+    }
+
+    public static View view(MethodInfo methodInfo) {
+        if (!methodInfo.className.equals("*")) return View.CLASS;
+        if (methodInfo.methodIntf != null && !methodInfo.methodIntf.equals("*")) return View.INTERFACE;
+        else return View.ANY;
     }
 
+    public static Level level(MethodInfo methodInfo) {
+        if (methodInfo.ejbName.equals("*")) return Level.PACKAGE;
+        if (methodInfo.methodName.equals("*")) return Level.BEAN;
+        if (methodInfo.methodParams == null) return Level.OVERLOADED_METHOD;
+        return Level.EXACT_METHOD;
+    }
+
+
     public static class MethodPermissionComparator extends BaseComparator<MethodPermissionInfo> {
         public int compare(MethodPermissionInfo a, MethodPermissionInfo b) {
             return compare(a.methods.get(0), b.methods.get(0));
@@ -272,7 +394,11 @@
             Level levelA = level(am);
             Level levelB = level(bm);
 
-            return levelA.ordinal() - levelB.ordinal();
+            // Primary sort
+            if (levelA != levelB) return levelA.ordinal() - levelB.ordinal();
+
+            // Secondary sort
+            return view(am).ordinal() - view(bm).ordinal();
         }
     }
 

Modified: openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodTransactionBuilder.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodTransactionBuilder.java?rev=640593&r1=640592&r2=640593&view=diff
==============================================================================
--- openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodTransactionBuilder.java (original)
+++ openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodTransactionBuilder.java Mon Mar 24 14:46:31 2008
@@ -45,6 +45,8 @@
 
     public static void applyTransactionAttributes(CoreDeploymentInfo deploymentInfo, List<MethodTransactionInfo> methodTransactionInfos) throws OpenEJBException {
 
+        if (deploymentInfo.isBeanManagedTransaction()) return;
+
         methodTransactionInfos = normalize(methodTransactionInfos);
 
         Map<Method, MethodAttributeInfo> attributes = resolveAttributes(methodTransactionInfos, deploymentInfo);

Modified: openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityContainer.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityContainer.java?rev=640593&r1=640592&r2=640593&view=diff
==============================================================================
--- openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityContainer.java (original)
+++ openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityContainer.java Mon Mar 24 14:46:31 2008
@@ -49,6 +49,7 @@
 import org.apache.openejb.core.Operation;
 import org.apache.openejb.core.ThreadContext;
 import org.apache.openejb.core.ExceptionType;
+import org.apache.openejb.core.ThreadContextListener;
 import org.apache.openejb.core.timer.EjbTimerService;
 import org.apache.openejb.core.timer.EjbTimerServiceImpl;
 import org.apache.openejb.core.transaction.TransactionContainer;
@@ -69,7 +70,7 @@
 
     private Object containerID = null;
 
-    public Logger logger = Logger.getInstance(LogCategory.OPENEJB, "org.apache.openejb.util.resources");
+    public static Logger logger = Logger.getInstance(LogCategory.OPENEJB, "org.apache.openejb.util.resources");
     private TransactionManager transactionManager;
     private SecurityService securityService;
 

Modified: openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulBeanManagedTxPolicy.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulBeanManagedTxPolicy.java?rev=640593&r1=640592&r2=640593&view=diff
==============================================================================
--- openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulBeanManagedTxPolicy.java (original)
+++ openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulBeanManagedTxPolicy.java Mon Mar 24 14:46:31 2008
@@ -36,6 +36,8 @@
     }
 
     public void beforeInvoke(Object instance, TransactionContext context) throws SystemException, ApplicationException {
+        context.callContext.set(Type.class, getPolicyType());
+        
         try {
             StatefulInstanceManager instanceManager = ((StatefulContainer)container).getInstanceManager();
 

Modified: openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessBeanManagedTxPolicy.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessBeanManagedTxPolicy.java?rev=640593&r1=640592&r2=640593&view=diff
==============================================================================
--- openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessBeanManagedTxPolicy.java (original)
+++ openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessBeanManagedTxPolicy.java Mon Mar 24 14:46:31 2008
@@ -40,6 +40,7 @@
     }
 
     public void beforeInvoke(Object instance, TransactionContext context) throws SystemException, ApplicationException {
+        context.callContext.set(Type.class, getPolicyType());
 
         context.clientTx = suspendTransaction(context);
     }

Modified: openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxMandatory.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxMandatory.java?rev=640593&r1=640592&r2=640593&view=diff
==============================================================================
--- openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxMandatory.java (original)
+++ openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxMandatory.java Mon Mar 24 14:46:31 2008
@@ -45,6 +45,7 @@
     }
 
     public void beforeInvoke(Object instance, TransactionContext context) throws SystemException, ApplicationException {
+        context.callContext.set(Type.class, getPolicyType());
 
         try {
 

Modified: openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxNever.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxNever.java?rev=640593&r1=640592&r2=640593&view=diff
==============================================================================
--- openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxNever.java (original)
+++ openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxNever.java Mon Mar 24 14:46:31 2008
@@ -43,6 +43,7 @@
     }
 
     public void beforeInvoke(Object instance, TransactionContext context) throws SystemException, ApplicationException {
+        context.callContext.set(Type.class, getPolicyType());
 
         try {
 

Modified: openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxNotSupported.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxNotSupported.java?rev=640593&r1=640592&r2=640593&view=diff
==============================================================================
--- openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxNotSupported.java (original)
+++ openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxNotSupported.java Mon Mar 24 14:46:31 2008
@@ -48,6 +48,7 @@
     }
 
     public void beforeInvoke(Object instance, TransactionContext context) throws SystemException, ApplicationException {
+        context.callContext.set(Type.class, getPolicyType());
 
         try {
 

Modified: openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxRequired.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxRequired.java?rev=640593&r1=640592&r2=640593&view=diff
==============================================================================
--- openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxRequired.java (original)
+++ openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxRequired.java Mon Mar 24 14:46:31 2008
@@ -49,6 +49,7 @@
     }
 
     public void beforeInvoke(Object instance, TransactionContext context) throws SystemException, ApplicationException {
+        context.callContext.set(Type.class, getPolicyType());
 
         try {
 

Modified: openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxRequiresNew.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxRequiresNew.java?rev=640593&r1=640592&r2=640593&view=diff
==============================================================================
--- openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxRequiresNew.java (original)
+++ openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxRequiresNew.java Mon Mar 24 14:46:31 2008
@@ -51,6 +51,7 @@
     }
 
     public void beforeInvoke(Object instance, TransactionContext context) throws SystemException, ApplicationException {
+        context.callContext.set(Type.class, getPolicyType());
 
         try {
 

Modified: openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxSupports.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxSupports.java?rev=640593&r1=640592&r2=640593&view=diff
==============================================================================
--- openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxSupports.java (original)
+++ openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TxSupports.java Mon Mar 24 14:46:31 2008
@@ -45,6 +45,7 @@
     }
 
     public void beforeInvoke(Object instance, TransactionContext context) throws SystemException, ApplicationException {
+        context.callContext.set(Type.class, getPolicyType());
 
         try {