felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r1478019 - in /felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo: ConfigurationTracker.java util/ServiceLocator.java
Date Wed, 01 May 2013 14:27:41 GMT
Author: clement
Date: Wed May  1 14:27:40 2013
New Revision: 1478019

URL: http://svn.apache.org/r1478019
Log:
Do not use the OSGi API using generics, KF does not support it.

Modified:
    felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/ConfigurationTracker.java
    felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/ServiceLocator.java

Modified: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/ConfigurationTracker.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/ConfigurationTracker.java?rev=1478019&r1=1478018&r2=1478019&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/ConfigurationTracker.java
(original)
+++ felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/ConfigurationTracker.java
Wed May  1 14:27:40 2013
@@ -45,7 +45,7 @@ public class ConfigurationTracker implem
      * The tracker instance.
      */
     private static ConfigurationTracker m_singleton;
-    private final ServiceRegistration<ConfigurationListener> m_registration;
+    private final ServiceRegistration m_registration;
     private final BundleContext m_context;
     private final Logger m_logger;
     private Map<String, IPojoFactory> m_factories = new HashMap<String, IPojoFactory>();
@@ -57,7 +57,7 @@ public class ConfigurationTracker implem
         Dictionary<String, Object> props = new Hashtable<String, Object>();
         props.put(Constants.SERVICE_DESCRIPTION, "iPOJO Configuration Admin Listener");
         props.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
-        m_registration = m_context.registerService(ConfigurationListener.class, this, props);
+        m_registration = m_context.registerService(ConfigurationListener.class.getName(),
this, props);
     }
 
     public static void initialize() {

Modified: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/ServiceLocator.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/ServiceLocator.java?rev=1478019&r1=1478018&r2=1478019&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/ServiceLocator.java
(original)
+++ felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/ServiceLocator.java
Wed May  1 14:27:40 2013
@@ -29,7 +29,7 @@ public class ServiceLocator<T> {
     private final BundleContext m_context;
     private final Class<T> m_clazz;
 
-    private ServiceReference<T> m_reference;
+    private ServiceReference m_reference;
     private T m_service;
 
     public ServiceLocator(Class<T> clazz, BundleContext context) {
@@ -42,11 +42,13 @@ public class ServiceLocator<T> {
                 return m_service;
          }
 
-        m_reference = m_context.getServiceReference(m_clazz);
+        // We can't use the generic version, as KF does not support it yet.
+        m_reference = m_context.getServiceReference(m_clazz.getName());
         if (m_reference == null) {
             return null;
         }
-        m_service = m_context.getService(m_reference);
+
+        m_service = (T) m_context.getService(m_reference);
 
         return m_service;
     }



Mime
View raw message