incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r920078 - in /incubator/aries/trunk/jndi/jndi-url/src: main/java/org/apache/aries/jndi/services/ main/java/org/apache/aries/jndi/url/ test/java/org/apache/aries/jndi/url/
Date Sun, 07 Mar 2010 20:04:03 GMT
Author: not
Date: Sun Mar  7 20:04:03 2010
New Revision: 920078

URL: http://svn.apache.org/viewvc?rev=920078&view=rev
Log:
ARIES-128 Following minor bug fixed:

1. ServiceHelper - generate the proxy in a doPriviledged code block to avoid failures with
Java 2 security on
2. ServiceRegistryListContext - stop recursively calling hasMore and make the NamingEnumeration
a static inner class

Modified:
    incubator/aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/services/ServiceHelper.java
    incubator/aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/url/ServiceRegistryListContext.java
    incubator/aries/trunk/jndi/jndi-url/src/test/java/org/apache/aries/jndi/url/ServiceRegistryContextTest.java

Modified: incubator/aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/services/ServiceHelper.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/services/ServiceHelper.java?rev=920078&r1=920077&r2=920078&view=diff
==============================================================================
--- incubator/aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/services/ServiceHelper.java
(original)
+++ incubator/aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/services/ServiceHelper.java
Sun Mar  7 20:04:03 2010
@@ -210,8 +210,19 @@
     
     return result;
   }
+  
+  private static Object proxy(final String interface1, final String filter, final boolean
rebind, 
+                              final BundleContext ctx, final ServicePair pair)
+  {
+    return AccessController.doPrivileged(new PrivilegedAction<Object>() {
+      public Object run()
+      {
+        return proxyPriviledged(interface1, filter, rebind, ctx, pair);
+      }
+    });
+  }
 
-  private static Object proxy(String interface1, String filter, boolean dynamicRebind,
+  private static Object proxyPriviledged(String interface1, String filter, boolean dynamicRebind,
       BundleContext ctx, ServicePair pair)
   {
     Object result;

Modified: incubator/aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/url/ServiceRegistryListContext.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/url/ServiceRegistryListContext.java?rev=920078&r1=920077&r2=920078&view=diff
==============================================================================
--- incubator/aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/url/ServiceRegistryListContext.java
(original)
+++ incubator/aries/trunk/jndi/jndi-url/src/main/java/org/apache/aries/jndi/url/ServiceRegistryListContext.java
Sun Mar  7 20:04:03 2010
@@ -53,7 +53,7 @@
     public void release(BundleContext ctx, ServiceReference ref);
   }
   
-  private class ServiceNamingEnumeration<T> implements NamingEnumeration<T>
+  private static class ServiceNamingEnumeration<T> implements NamingEnumeration<T>
   {
     private BundleContext ctx;
     private ServiceReference[] refs;
@@ -76,7 +76,7 @@
 
     public boolean hasMore() throws NamingException
     {
-      return hasMore();
+      return hasMoreElements();
     }
 
     public T next() throws NamingException

Modified: incubator/aries/trunk/jndi/jndi-url/src/test/java/org/apache/aries/jndi/url/ServiceRegistryContextTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jndi/jndi-url/src/test/java/org/apache/aries/jndi/url/ServiceRegistryContextTest.java?rev=920078&r1=920077&r2=920078&view=diff
==============================================================================
--- incubator/aries/trunk/jndi/jndi-url/src/test/java/org/apache/aries/jndi/url/ServiceRegistryContextTest.java
(original)
+++ incubator/aries/trunk/jndi/jndi-url/src/test/java/org/apache/aries/jndi/url/ServiceRegistryContextTest.java
Sun Mar  7 20:04:03 2010
@@ -514,8 +514,8 @@
     t = Skeleton.newMock(Runnable.class);
     t2 = Skeleton.newMock(Runnable.class);
 
-    reg = bc.registerService(className, t, null);
-    reg2 = bc.registerService(className, t2, props);
+    bc.registerService(className, t, null);
+    bc.registerService(className, t2, props);
     
     r = (Runnable) ctx.lookup("osgi:service/java.lang.Runnable");
     



Mime
View raw message