Skip to content
Permalink
Browse files
YOKO-431 Update PortableRemoteObject classloading to OSGi way, but St…
…ubInitializer has some problem

git-svn-id: https://svn.apache.org/repos/asf/geronimo/yoko/trunk@1072588 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Ming Xia committed Feb 20, 2011
1 parent 4a91008 commit 268365aed6cd76070e7b9b9ecbe7de335454d70b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
@@ -36,6 +36,7 @@
import org.apache.yoko.rmi.util.stub.MethodRef;
import org.apache.yoko.rmi.util.stub.StubClass;
import org.apache.yoko.rmi.util.stub.StubInitializer;
import org.apache.yoko.rmispec.util.UtilLoader;
import org.omg.CORBA.BAD_INV_ORDER;
import org.omg.CORBA.portable.ObjectImpl;

@@ -565,7 +566,7 @@ private static StubInitializer getRMIStubInitializer() {
if (initializer == null) {
String factory = (String)AccessController.doPrivileged(new GetSystemPropertyAction("org.apache.yoko.rmi.RMIStubInitializerClass", defaultInitializer));
try {
initializer = (StubInitializer)(Util.loadClass(factory, null, null).newInstance());
initializer = (StubInitializer)(UtilLoader.loadServiceClass(factory, "org.apache.yoko.rmi.RMIStubInitializerClass").newInstance());
} catch (Exception e) {
throw (org.omg.CORBA.INITIALIZE)new org.omg.CORBA.INITIALIZE(
"Can not create RMIStubInitializer: " + factory).initCause(e);
@@ -23,18 +23,21 @@
import java.security.AccessController;
import javax.rmi.CORBA.PortableRemoteObjectDelegate;
import javax.rmi.CORBA.Util;
import javax.rmi.CORBA.UtilDelegate;

import org.apache.yoko.rmispec.util.GetSystemPropertyAction;
import org.apache.yoko.rmispec.util.UtilLoader;

public class PortableRemoteObject {
private static PortableRemoteObjectDelegate delegate = null;
private static final String defaultDelegate = "org.apache.yoko.rmi.impl.PortableRemoteObjectImpl";
private static final String DELEGATEKEY = "javax.rmi.CORBA.PortableRemoteObjectClass";

static {
// Initialize delegate
String delegateName = (String)AccessController.doPrivileged(new GetSystemPropertyAction("javax.rmi.CORBA.PortableRemoteObjectClass", defaultDelegate));
String delegateName = (String)AccessController.doPrivileged(new GetSystemPropertyAction(DELEGATEKEY, defaultDelegate));
try {
delegate = (PortableRemoteObjectDelegate)Util.loadClass(delegateName, null, null).newInstance();
delegate = (PortableRemoteObjectDelegate)UtilLoader.loadServiceClass(delegateName, DELEGATEKEY).newInstance();
} catch (Throwable e) {
org.omg.CORBA.INITIALIZE ex = new org.omg.CORBA.INITIALIZE("Can not create PortableRemoteObject delegate: "+delegateName);
ex.initCause(e);

0 comments on commit 268365a

Please sign in to comment.