aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r1103430 - /aries/trunk/util/src/main/java/org/apache/aries/util/service/registry/ServicePair.java
Date Sun, 15 May 2011 15:30:24 GMT
Author: not
Date: Sun May 15 15:30:24 2011
New Revision: 1103430

URL: http://svn.apache.org/viewvc?rev=1103430&view=rev
Log:
ARIES-649 ARIES-647 Oops I managed to backout ARIES-647 when I committed ARIES-649. Needed
to take more care of what SVN was trying to tell me.

Modified:
    aries/trunk/util/src/main/java/org/apache/aries/util/service/registry/ServicePair.java

Modified: aries/trunk/util/src/main/java/org/apache/aries/util/service/registry/ServicePair.java
URL: http://svn.apache.org/viewvc/aries/trunk/util/src/main/java/org/apache/aries/util/service/registry/ServicePair.java?rev=1103430&r1=1103429&r2=1103430&view=diff
==============================================================================
--- aries/trunk/util/src/main/java/org/apache/aries/util/service/registry/ServicePair.java
(original)
+++ aries/trunk/util/src/main/java/org/apache/aries/util/service/registry/ServicePair.java
Sun May 15 15:30:24 2011
@@ -18,6 +18,9 @@
  */
 package org.apache.aries.util.service.registry;
 
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 
@@ -45,7 +48,12 @@ public class ServicePair<T>
   public T get()
   {
     if (serviceObject == null && ref.getBundle() != null) {
-      serviceObject = (T) ctx.getService(ref);
+      serviceObject = AccessController.doPrivileged(new PrivilegedAction<T>() {
+          public T run()
+          {
+            return serviceObject = (T) ctx.getService(ref);
+          }
+        });
     }
     
     return serviceObject;



Mime
View raw message