openejb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r452263 - in /incubator/openejb/trunk/openejb2/modules/openejb-core/src: main/java/org/apache/openejb/assembler/ main/java/org/apache/openejb/client/ test/java/org/apache/openejb/client/
Date Mon, 02 Oct 2006 23:32:26 GMT
Author: djencks
Date: Mon Oct  2 16:32:25 2006
New Revision: 452263

URL: http://svn.apache.org/viewvc?view=rev&rev=452263
Log:
GERONIMO-2153 Install global jndi work, base all jndi on xbean-naming.  This does not include
resource or ejb binding gbeans.  Openejb changes primarily involve using xbean classes instead
of geronimo classes.

Removed:
    incubator/openejb/trunk/openejb2/modules/openejb-core/src/main/java/org/apache/openejb/client/ContextImpl.java
Modified:
    incubator/openejb/trunk/openejb2/modules/openejb-core/src/main/java/org/apache/openejb/assembler/ContainerBuilder.java
    incubator/openejb/trunk/openejb2/modules/openejb-core/src/main/java/org/apache/openejb/client/JNDIResponse.java
    incubator/openejb/trunk/openejb2/modules/openejb-core/src/test/java/org/apache/openejb/client/JNDIResponseTest.java

Modified: incubator/openejb/trunk/openejb2/modules/openejb-core/src/main/java/org/apache/openejb/assembler/ContainerBuilder.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-core/src/main/java/org/apache/openejb/assembler/ContainerBuilder.java?view=diff&rev=452263&r1=452262&r2=452263
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-core/src/main/java/org/apache/openejb/assembler/ContainerBuilder.java
(original)
+++ incubator/openejb/trunk/openejb2/modules/openejb-core/src/main/java/org/apache/openejb/assembler/ContainerBuilder.java
Mon Oct  2 16:32:25 2006
@@ -19,13 +19,7 @@
 import java.lang.reflect.Method;
 import java.util.HashMap;
 import java.util.Properties;
-import javax.naming.Context;
-import javax.naming.NameClassPair;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.transaction.UserTransaction;
 
-import org.apache.geronimo.naming.java.ReadOnlyContext;
 import org.apache.openejb.EJBComponentType;
 import org.apache.openejb.OpenEJBException;
 
@@ -104,24 +98,4 @@
 
     }
 
-
-    static class ReadOnlyContextWrapper extends ReadOnlyContext {
-        public ReadOnlyContextWrapper(Context ctx, UserTransaction userTransaction) throws
NamingException {
-            super();
-            NamingEnumeration e = ctx.list("");
-
-            while (e.hasMoreElements()) {
-                NameClassPair pair = (NameClassPair) e.next();
-
-                String name = pair.getName();
-                Object value = ctx.lookup(name);
-
-                internalBind(name, value);
-            }
-
-            if (userTransaction != null) {
-                internalBind("UserTransaction", userTransaction);
-            }
-        }
-    }
 }

Modified: incubator/openejb/trunk/openejb2/modules/openejb-core/src/main/java/org/apache/openejb/client/JNDIResponse.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-core/src/main/java/org/apache/openejb/client/JNDIResponse.java?view=diff&rev=452263&r1=452262&r2=452263
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-core/src/main/java/org/apache/openejb/client/JNDIResponse.java
(original)
+++ incubator/openejb/trunk/openejb2/modules/openejb-core/src/main/java/org/apache/openejb/client/JNDIResponse.java
Mon Oct  2 16:32:25 2006
@@ -19,12 +19,16 @@
 import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
+import java.util.HashMap;
+import java.util.Map;
+
 import javax.naming.Binding;
 import javax.naming.Context;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 
 import org.apache.openejb.proxy.EJBProxyReference;
+import org.apache.xbean.naming.context.ImmutableContext;
 
 /**
  *
@@ -101,12 +105,12 @@
 
     private Context readContextTree(ObjectInput in) throws IOException, ClassNotFoundException
{
 
-        ContextImpl context = new ContextImpl();
+        Map contextMap = new HashMap();
 
         CONTEXT_LOOP: while (true) {
             byte type = in.readByte();
-            String name = null;
-            Object obj = null;
+            String name;
+            Object obj;
             switch (type) {
                 case CONTEXT:
                     name = in.readUTF();
@@ -121,13 +125,15 @@
                     obj = in.readObject();
             }
 
-            try {
-                context.internalBind(name,obj);
-            } catch (NamingException e) {
-
-            }
+                contextMap.put(name,obj);
         }
 
+        Context context = null;
+        try {
+            context = new ImmutableContext(contextMap);
+        } catch (NamingException e) {
+            //ignoring seems like a really bad idea
+        }
 
         return context;
     }

Modified: incubator/openejb/trunk/openejb2/modules/openejb-core/src/test/java/org/apache/openejb/client/JNDIResponseTest.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-core/src/test/java/org/apache/openejb/client/JNDIResponseTest.java?view=diff&rev=452263&r1=452262&r2=452263
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-core/src/test/java/org/apache/openejb/client/JNDIResponseTest.java
(original)
+++ incubator/openejb/trunk/openejb2/modules/openejb-core/src/test/java/org/apache/openejb/client/JNDIResponseTest.java
Mon Oct  2 16:32:25 2006
@@ -27,6 +27,7 @@
 import javax.naming.Binding;
 
 import junit.framework.TestCase;
+import org.apache.xbean.naming.context.ImmutableContext;
 
 public class JNDIResponseTest extends TestCase {
     private Context context;
@@ -39,7 +40,7 @@
         map.put("music/jazz/bebop/year", new Integer(1950));
         map.put("music/country", Boolean.FALSE);
         map.put("music/latin/funk/group", "Los Amigos Invisibles");
-        context = new ContextImpl(map);
+        context = new ImmutableContext(map);
 
     }
 



Mime
View raw message