incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lin...@apache.org
Subject svn commit: r1040685 - /incubator/aries/trunk/subsystem/subsystem-scope-impl/src/main/java/org/apache/aries/subsystem/scope/impl/ScopeAdminServiceFactory.java
Date Tue, 30 Nov 2010 18:36:18 GMT
Author: linsun
Date: Tue Nov 30 18:36:18 2010
New Revision: 1040685

URL: http://svn.apache.org/viewvc?rev=1040685&view=rev
Log:
register the root scope in service registry

Modified:
    incubator/aries/trunk/subsystem/subsystem-scope-impl/src/main/java/org/apache/aries/subsystem/scope/impl/ScopeAdminServiceFactory.java

Modified: incubator/aries/trunk/subsystem/subsystem-scope-impl/src/main/java/org/apache/aries/subsystem/scope/impl/ScopeAdminServiceFactory.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/subsystem/subsystem-scope-impl/src/main/java/org/apache/aries/subsystem/scope/impl/ScopeAdminServiceFactory.java?rev=1040685&r1=1040684&r2=1040685&view=diff
==============================================================================
--- incubator/aries/trunk/subsystem/subsystem-scope-impl/src/main/java/org/apache/aries/subsystem/scope/impl/ScopeAdminServiceFactory.java
(original)
+++ incubator/aries/trunk/subsystem/subsystem-scope-impl/src/main/java/org/apache/aries/subsystem/scope/impl/ScopeAdminServiceFactory.java
Tue Nov 30 18:36:18 2010
@@ -64,6 +64,7 @@ public class ScopeAdminServiceFactory im
     private ServiceTracker serviceTracker;
     private List<ServiceRegistration> srs = new ArrayList<ServiceRegistration>();
     public static final String SERVICE_CAPABILITY = "osgi.service";
+    private ServiceRegistration rootScopeAdminserviceReg;
     
     public void init() throws InvalidSyntaxException {
         context = Activator.getBundleContext();
@@ -96,6 +97,9 @@ public class ScopeAdminServiceFactory im
                 });
         defaultScopeAdmin = new ScopeAdminImpl(null, new ScopeImpl("root",
                 context));
+        rootScopeAdminserviceReg = context.registerService(ScopeAdmin.class.getName(), 
+                defaultScopeAdmin, 
+                DictionaryBuilder.build("ScopeName", defaultScopeAdmin.getScope().getName(),
"ScopeId", defaultScopeAdmin.getScope().getId()));
         admins.add(defaultScopeAdmin);
         references.put(defaultScopeAdmin, new Long(0));
         serviceTracker.open();
@@ -116,6 +120,10 @@ public class ScopeAdminServiceFactory im
         for (ServiceRegistration sr : srs) {
             sr.unregister();
         }
+        
+        if (rootScopeAdminserviceReg != null) {
+            rootScopeAdminserviceReg.unregister();
+        }
     }
 
     public synchronized Object getService(Bundle bundle, ServiceRegistration registration)
{



Mime
View raw message