dblevins 2004/09/28 23:39:44
Modified: modules/core/src/java/org/openejb/client/naming/java
javaURLContextFactory.java
Log:
App client requests work now. Hammered exception handling
client/server requests for JNDI. Requests now take place in the scope
of the classloader of the requesting application. Serialization of
proxies in JNDI trees now functions but needs more work.
Revision Changes Path
1.2 +11 -15
openejb/modules/core/src/java/org/openejb/client/naming/java/javaURLContextFactory.java
Index: javaURLContextFactory.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/client/naming/java/javaURLContextFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- javaURLContextFactory.java 23 Sep 2004 19:23:18 -0000 1.1
+++ javaURLContextFactory.java 29 Sep 2004 03:39:44 -0000 1.2
@@ -44,25 +44,21 @@
*/
package org.openejb.client.naming.java;
-import org.apache.geronimo.kernel.Kernel;
-
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
+import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.Name;
+import javax.naming.NamingException;
import javax.naming.OperationNotSupportedException;
+import javax.naming.spi.InitialContextFactory;
import javax.naming.spi.ObjectFactory;
-import java.util.Hashtable;
-public class javaURLContextFactory implements ObjectFactory {
- private static final ObjectName JNDI_PROVIDER;
+import org.apache.geronimo.naming.java.RootContext;
+
+public class javaURLContextFactory implements ObjectFactory, InitialContextFactory {
+
+ public Context getInitialContext(Hashtable environment) throws NamingException {
+ return new RootContext(environment);
- static {
- try {
- JNDI_PROVIDER = ObjectName.getInstance("client:type=JNDIProvider");
- } catch (MalformedObjectNameException e) {
- throw new RuntimeException(e);
- }
}
public Object getObjectInstance(Object obj, Name name, Context nameCtx,
Hashtable environment) throws Exception {
@@ -73,7 +69,7 @@
/* A null obj ref means the NamingManager is requesting
* a Context that can resolve the 'java:' schema
*/
- return Kernel.getSingleKernel().getAttribute(JNDI_PROVIDER, "context");
+ return getInitialContext(environment);
}