felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r919614 - in /felix/trunk/useradmin/src/main/java/org/apache/felix/useradmin/impl: Activator.java UserAdminEventDipatcherImpl.java UserAdminEventDispatcherImpl.java
Date Fri, 05 Mar 2010 21:03:42 GMT
Author: marrs
Date: Fri Mar  5 21:03:42 2010
New Revision: 919614

URL: http://svn.apache.org/viewvc?rev=919614&view=rev
Log:
Added a service.pid to the UserAdmin service, because it did not have one and the spec requires
the user admin to send its pid as part of each event. Because this pid was missing, user admin
was trying to send invalid events and failed to work (but only if event admin is actually
present). Furthermore, fixed a typo in a class name.

Added:
    felix/trunk/useradmin/src/main/java/org/apache/felix/useradmin/impl/UserAdminEventDispatcherImpl.java
      - copied, changed from r919599, felix/trunk/useradmin/src/main/java/org/apache/felix/useradmin/impl/UserAdminEventDipatcherImpl.java
Removed:
    felix/trunk/useradmin/src/main/java/org/apache/felix/useradmin/impl/UserAdminEventDipatcherImpl.java
Modified:
    felix/trunk/useradmin/src/main/java/org/apache/felix/useradmin/impl/Activator.java

Modified: felix/trunk/useradmin/src/main/java/org/apache/felix/useradmin/impl/Activator.java
URL: http://svn.apache.org/viewvc/felix/trunk/useradmin/src/main/java/org/apache/felix/useradmin/impl/Activator.java?rev=919614&r1=919613&r2=919614&view=diff
==============================================================================
--- felix/trunk/useradmin/src/main/java/org/apache/felix/useradmin/impl/Activator.java (original)
+++ felix/trunk/useradmin/src/main/java/org/apache/felix/useradmin/impl/Activator.java Fri
Mar  5 21:03:42 2010
@@ -16,11 +16,14 @@
  */
 package org.apache.felix.useradmin.impl;
 
+import java.util.Properties;
+
+import org.apache.felix.useradmin.UserAdminEventDispatcher;
 import org.apache.felix.useradmin.UserAdminRepository;
 import org.apache.felix.useradmin.UserAdminRepositoryManager;
-import org.apache.felix.useradmin.UserAdminEventDispatcher;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceRegistration;
 import org.osgi.service.useradmin.UserAdmin;
 
@@ -34,6 +37,7 @@
  */
 public class Activator implements BundleActivator
 {
+    private static final String PID = "org.apache.felix.useradmin";
     private Logger logger;
     private ServiceRegistration registration;
     private UserAdminServiceImpl userAdmin;
@@ -51,11 +55,13 @@
         //Creating manager for roles repository
         UserAdminRepositoryManager repositoryManager = new UserAdminRepositoryManagerImpl(logger,
repository);
         //Creating dispatcher for UserAdmin events
-        UserAdminEventDispatcher eventDispatcher = new UserAdminEventDipatcherImpl(context);
+        UserAdminEventDispatcher eventDispatcher = new UserAdminEventDispatcherImpl(context);
         userAdmin = new UserAdminServiceImpl(context, repositoryManager, logger, eventDispatcher);
         repositoryManager.initialize(userAdmin);
 
-        registration = context.registerService(UserAdmin.class.getName(), userAdmin, null);
+        Properties props = new Properties();
+        props.put(Constants.SERVICE_PID, PID);
+        registration = context.registerService(UserAdmin.class.getName(), userAdmin, props);
         userAdmin.setServiceRef(registration.getReference());
     }
 

Copied: felix/trunk/useradmin/src/main/java/org/apache/felix/useradmin/impl/UserAdminEventDispatcherImpl.java
(from r919599, felix/trunk/useradmin/src/main/java/org/apache/felix/useradmin/impl/UserAdminEventDipatcherImpl.java)
URL: http://svn.apache.org/viewvc/felix/trunk/useradmin/src/main/java/org/apache/felix/useradmin/impl/UserAdminEventDispatcherImpl.java?p2=felix/trunk/useradmin/src/main/java/org/apache/felix/useradmin/impl/UserAdminEventDispatcherImpl.java&p1=felix/trunk/useradmin/src/main/java/org/apache/felix/useradmin/impl/UserAdminEventDipatcherImpl.java&r1=919599&r2=919614&rev=919614&view=diff
==============================================================================
--- felix/trunk/useradmin/src/main/java/org/apache/felix/useradmin/impl/UserAdminEventDipatcherImpl.java
(original)
+++ felix/trunk/useradmin/src/main/java/org/apache/felix/useradmin/impl/UserAdminEventDispatcherImpl.java
Fri Mar  5 21:03:42 2010
@@ -36,7 +36,7 @@
  * 
  * @version $Rev$ $Date$
  */
-public class UserAdminEventDipatcherImpl extends Thread implements UserAdminEventDispatcher
+public class UserAdminEventDispatcherImpl extends Thread implements UserAdminEventDispatcher
 {
     private Vector queue;
     private ServiceTracker userAdminTrackerListener;
@@ -50,7 +50,7 @@
      * Setting thread as a daemon.
      * @param context bundle context
      */
-    public UserAdminEventDipatcherImpl(BundleContext context)
+    public UserAdminEventDispatcherImpl(BundleContext context)
     {
         super();
         this.queue = new Vector();



Mime
View raw message