geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiam...@apache.org
Subject svn commit: r1071188 - in /geronimo/yoko/trunk: yoko-core/src/main/resources/OSGI-INF/blueprint/ yoko-rmi-spec/src/main/java/javax/rmi/CORBA/ yoko-rmi-spec/src/main/java/org/apache/yoko/rmispec/util/
Date Wed, 16 Feb 2011 09:35:42 GMT
Author: xiaming
Date: Wed Feb 16 09:35:41 2011
New Revision: 1071188

URL: http://svn.apache.org/viewvc?rev=1071188&view=rev
Log:
YOKO-431 use service class key to search impl. first in the blueprint service registry, and
correct a service key name for ORBSingleton

Modified:
    geronimo/yoko/trunk/yoko-core/src/main/resources/OSGI-INF/blueprint/provider.xml
    geronimo/yoko/trunk/yoko-rmi-spec/src/main/java/javax/rmi/CORBA/Stub.java
    geronimo/yoko/trunk/yoko-rmi-spec/src/main/java/javax/rmi/CORBA/Util.java
    geronimo/yoko/trunk/yoko-rmi-spec/src/main/java/org/apache/yoko/rmispec/util/UtilLoader.java

Modified: geronimo/yoko/trunk/yoko-core/src/main/resources/OSGI-INF/blueprint/provider.xml
URL: http://svn.apache.org/viewvc/geronimo/yoko/trunk/yoko-core/src/main/resources/OSGI-INF/blueprint/provider.xml?rev=1071188&r1=1071187&r2=1071188&view=diff
==============================================================================
--- geronimo/yoko/trunk/yoko-core/src/main/resources/OSGI-INF/blueprint/provider.xml (original)
+++ geronimo/yoko/trunk/yoko-core/src/main/resources/OSGI-INF/blueprint/provider.xml Wed Feb
16 09:35:41 2011
@@ -48,7 +48,7 @@ limitations under the License.
           init-method="start"
           destroy-method="stop">
         <argument>
-            <value>org.omg.CORBA.ORBSingleton</value>
+            <value>org.omg.CORBA.ORBSingletonClass</value>
         </argument>
         <argument>
             <value>org.apache.yoko.orb.CORBA.ORBSingleton</value>

Modified: geronimo/yoko/trunk/yoko-rmi-spec/src/main/java/javax/rmi/CORBA/Stub.java
URL: http://svn.apache.org/viewvc/geronimo/yoko/trunk/yoko-rmi-spec/src/main/java/javax/rmi/CORBA/Stub.java?rev=1071188&r1=1071187&r2=1071188&view=diff
==============================================================================
--- geronimo/yoko/trunk/yoko-rmi-spec/src/main/java/javax/rmi/CORBA/Stub.java (original)
+++ geronimo/yoko/trunk/yoko-rmi-spec/src/main/java/javax/rmi/CORBA/Stub.java Wed Feb 16 09:35:41
2011
@@ -25,6 +25,7 @@ import java.rmi.RemoteException;
 import java.security.AccessController;
 
 import org.apache.yoko.rmispec.util.GetSystemPropertyAction;
+import org.apache.yoko.rmispec.util.UtilLoader;
 import org.omg.CORBA.ORB;
 import org.omg.CORBA_2_3.portable.ObjectImpl;
 
@@ -33,14 +34,15 @@ public abstract class Stub extends Objec
 
     private transient StubDelegate delegate = null;
     private static final String defaultDelegate = "org.apache.yoko.rmi.impl.StubImpl";
+    private static final String DELEGATEKEY = "javax.rmi.CORBA.StubClass";
     // the class we use to create delegates.  This is loaded once,
     private static Class delegateClass = null;
 
     static {
         // Initialize delegate
-        String delegateName = (String)AccessController.doPrivileged(new GetSystemPropertyAction("javax.rmi.CORBA.StubClass",
defaultDelegate));
+        String delegateName = (String)AccessController.doPrivileged(new GetSystemPropertyAction(DELEGATEKEY,
defaultDelegate));
         try {
-            delegateClass = Util.loadClass(delegateName, null, null);
+        	delegateClass = UtilLoader.loadServiceClass(delegateName, DELEGATEKEY);
         } catch (Exception e) {
             org.omg.CORBA.INITIALIZE ex = new org.omg.CORBA.INITIALIZE("Can not create Stub
delegate: " + delegateName);
             ex.initCause(e); 

Modified: geronimo/yoko/trunk/yoko-rmi-spec/src/main/java/javax/rmi/CORBA/Util.java
URL: http://svn.apache.org/viewvc/geronimo/yoko/trunk/yoko-rmi-spec/src/main/java/javax/rmi/CORBA/Util.java?rev=1071188&r1=1071187&r2=1071188&view=diff
==============================================================================
--- geronimo/yoko/trunk/yoko-rmi-spec/src/main/java/javax/rmi/CORBA/Util.java (original)
+++ geronimo/yoko/trunk/yoko-rmi-spec/src/main/java/javax/rmi/CORBA/Util.java Wed Feb 16 09:35:41
2011
@@ -32,18 +32,19 @@ import org.apache.yoko.rmispec.util.Util
 public class Util {
     private static UtilDelegate delegate = null;
     private static final String defaultDelegate = "org.apache.yoko.rmi.impl.UtilImpl";
+    private static final String DELEGATEKEY = "javax.rmi.CORBA.UtilClass";
 
     // To hide the default constructor we should implement empty private constructor
     private Util() {}
 
     static {
         // Initialize delegate
-        String delegateName = (String)AccessController.doPrivileged(new GetSystemPropertyAction("javax.rmi.CORBA.UtilClass",
defaultDelegate));
+        String delegateName = (String)AccessController.doPrivileged(new GetSystemPropertyAction(DELEGATEKEY,
defaultDelegate));
         try {
 
             // this is a little bit recursive, but this will use the full default search
order for locating
             // this.
-            delegate = (UtilDelegate)Util.loadClass(delegateName, null, null).newInstance();
+        	delegate = (UtilDelegate)UtilLoader.loadServiceClass(delegateName, DELEGATEKEY).newInstance();
         } catch (Throwable e) {
             org.omg.CORBA.INITIALIZE ex = new org.omg.CORBA.INITIALIZE("Can not create Util
delegate: "+delegateName);
             ex.initCause(e); 

Modified: geronimo/yoko/trunk/yoko-rmi-spec/src/main/java/org/apache/yoko/rmispec/util/UtilLoader.java
URL: http://svn.apache.org/viewvc/geronimo/yoko/trunk/yoko-rmi-spec/src/main/java/org/apache/yoko/rmispec/util/UtilLoader.java?rev=1071188&r1=1071187&r2=1071188&view=diff
==============================================================================
--- geronimo/yoko/trunk/yoko-rmi-spec/src/main/java/org/apache/yoko/rmispec/util/UtilLoader.java
(original)
+++ geronimo/yoko/trunk/yoko-rmi-spec/src/main/java/org/apache/yoko/rmispec/util/UtilLoader.java
Wed Feb 16 09:35:41 2011
@@ -36,10 +36,21 @@ public class UtilLoader {
     // since that method will call loadClass0 which uses this field... if it is below the
static
     // initializer the _secman field will be null
     private static final SecMan _secman = getSecMan();
+    
+    static public Class<?> loadServiceClass(String delegateName, String delegateKey)
throws ClassNotFoundException {
+    	
+    	try {
+    		return ProviderLocator.getServiceClass(delegateKey, null, null);
+    	} catch (ClassNotFoundException e){
+    		// skip
+    	}
+    	
+    	return loadClass0(delegateName, null, null);
+    }
 
     static public Class loadClass(String name, String codebase, ClassLoader loader)
             throws ClassNotFoundException {
-        Class result = null;
+        
 
         try {
             return ProviderLocator.loadClass(name, null, loader);
@@ -47,7 +58,14 @@ public class UtilLoader {
             //skip
         }
 
-        ClassLoader stackLoader = null;
+        return loadClass0(name, codebase, loader);
+    }
+    
+    private static Class<?> loadClass0(String name, String codebase, ClassLoader loader)

+    	throws ClassNotFoundException {
+    	Class result = null;
+    	
+    	ClassLoader stackLoader = null;
         ClassLoader thisLoader = UtilLoader.class.getClassLoader(); 
         Class[] stack = _secman.getClassContext();
         for (int i = 1; i < stack.length; i++) {



Mime
View raw message