felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r994967 - /felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/
Date Wed, 08 Sep 2010 10:09:39 GMT
Author: marrs
Date: Wed Sep  8 10:09:38 2010
New Revision: 994967

URL: http://svn.apache.org/viewvc?rev=994967&view=rev
Log:
Big refactoring, renamed "Service" to "Component" whenever it was referring to the thing that
has dependencies and registers itself as a service.

Modified:
    felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/Activator.java
    felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AdapterServiceBuilder.java
    felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AspectServiceBuilder.java
    felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/BundleAdapterServiceBuilder.java
    felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DependencyManagerRuntime.java
    felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/FactoryConfigurationAdapterServiceBuilder.java
    felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/FactorySet.java
    felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ResourceAdapterServiceBuilder.java
    felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceBuilder.java
    felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceComponentBuilder.java
    felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceLifecycleHandler.java

Modified: felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/Activator.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/Activator.java?rev=994967&r1=994966&r2=994967&view=diff
==============================================================================
--- felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/Activator.java
(original)
+++ felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/Activator.java
Wed Sep  8 10:09:38 2010
@@ -42,7 +42,7 @@ public class Activator extends Dependenc
         // and we'll eventually use a Null LogService Object.
 
         boolean logActive = "true".equals(context.getProperty("dm.runtime.log"));
-        dm.add(createService()
+        dm.add(createComponent()
                .setImplementation(DependencyManagerRuntime.class)
                .add(createServiceDependency()
                    .setService(LogService.class)

Modified: felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AdapterServiceBuilder.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AdapterServiceBuilder.java?rev=994967&r1=994966&r2=994967&view=diff
==============================================================================
--- felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AdapterServiceBuilder.java
(original)
+++ felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AdapterServiceBuilder.java
Wed Sep  8 10:09:38 2010
@@ -22,7 +22,7 @@ import java.util.Dictionary;
 import java.util.List;
 
 import org.apache.felix.dm.DependencyManager;
-import org.apache.felix.dm.Service;
+import org.apache.felix.dm.Component;
 import org.osgi.framework.Bundle;
 
 /**
@@ -48,7 +48,7 @@ public class AdapterServiceBuilder exten
         Dictionary<String, Object> adapterProperties = srvMeta.getDictionary(Params.properties,
null);
         Class<?> adapteeService = b.loadClass(srvMeta.getString(Params.adapteeService));
         String adapteeFilter = srvMeta.getString(Params.adapteeFilter, null);     
-        Service service = dm.createAdapterService(adapteeService, adapteeFilter);
+        Component service = dm.createAdapterService(adapteeService, adapteeFilter);
         service.setInterface(provides, adapterProperties);
         
         String factoryMethod = srvMeta.getString(Params.factoryMethod, null);

Modified: felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AspectServiceBuilder.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AspectServiceBuilder.java?rev=994967&r1=994966&r2=994967&view=diff
==============================================================================
--- felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AspectServiceBuilder.java
(original)
+++ felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/AspectServiceBuilder.java
Wed Sep  8 10:09:38 2010
@@ -22,7 +22,7 @@ import java.util.Dictionary;
 import java.util.List;
 
 import org.apache.felix.dm.DependencyManager;
-import org.apache.felix.dm.Service;
+import org.apache.felix.dm.Component;
 import org.osgi.framework.Bundle;
 import org.osgi.service.log.LogService;
 
@@ -52,7 +52,7 @@ public class AspectServiceBuilder extend
         Object implClass = b.loadClass(implClassName);        
         String field = srvMeta.getString(Params.field, null);  
         String factoryMethod = srvMeta.getString(Params.factoryMethod, null);
-        Service service = dm.createAspectService(serviceInterface, serviceFilter, ranking,
field)
+        Component service = dm.createAspectService(serviceInterface, serviceFilter, ranking,
field)
                             .setServiceProperties(aspectProperties);
         if (factoryMethod == null)
         {

Modified: felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/BundleAdapterServiceBuilder.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/BundleAdapterServiceBuilder.java?rev=994967&r1=994966&r2=994967&view=diff
==============================================================================
--- felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/BundleAdapterServiceBuilder.java
(original)
+++ felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/BundleAdapterServiceBuilder.java
Wed Sep  8 10:09:38 2010
@@ -22,7 +22,7 @@ import java.util.Dictionary;
 import java.util.List;
 
 import org.apache.felix.dm.DependencyManager;
-import org.apache.felix.dm.Service;
+import org.apache.felix.dm.Component;
 import org.osgi.framework.Bundle;
 
 public class BundleAdapterServiceBuilder extends ServiceComponentBuilder
@@ -45,7 +45,7 @@ public class BundleAdapterServiceBuilder
         String[] provides = srvMeta.getStrings(Params.provides, null);
         Dictionary<String, Object> properties = srvMeta.getDictionary(Params.properties,
null);
         boolean propagate = "true".equals(srvMeta.getString(Params.propagate, "false"));
-        Service srv = dm.createBundleAdapterService(stateMask, filter, propagate);
+        Component srv = dm.createBundleAdapterService(stateMask, filter, propagate);
         srv.setInterface(provides, properties);
         String factoryMethod = srvMeta.getString(Params.factoryMethod, null);
         if (factoryMethod == null)

Modified: felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DependencyManagerRuntime.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DependencyManagerRuntime.java?rev=994967&r1=994966&r2=994967&view=diff
==============================================================================
--- felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DependencyManagerRuntime.java
(original)
+++ felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/DependencyManagerRuntime.java
Wed Sep  8 10:09:38 2010
@@ -27,7 +27,7 @@ import java.util.List;
 import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.felix.dm.DependencyManager;
-import org.apache.felix.dm.Service;
+import org.apache.felix.dm.Component;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleEvent;
@@ -88,8 +88,8 @@ public class DependencyManagerRuntime im
 
         for (DependencyManager dm: m_managers.values())
         {
-            List<Service> services = new ArrayList<Service>(dm.getServices());
-            for (Service service: services)
+            List<Component> services = new ArrayList<Component>(dm.getServices());
+            for (Component service: services)
             {
                 dm.remove(service);
             }
@@ -159,8 +159,8 @@ public class DependencyManagerRuntime im
         DependencyManager dm = m_managers.remove(b);
         if (dm != null)
         {
-            List<Service> services = new ArrayList(dm.getServices());
-            for (Service service : services)
+            List<Component> services = new ArrayList(dm.getServices());
+            for (Component service : services)
             {
                 m_log.log(LogService.LOG_INFO, "Runtime: Removing service: " + service);
                 dm.remove(service);

Modified: felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/FactoryConfigurationAdapterServiceBuilder.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/FactoryConfigurationAdapterServiceBuilder.java?rev=994967&r1=994966&r2=994967&view=diff
==============================================================================
--- felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/FactoryConfigurationAdapterServiceBuilder.java
(original)
+++ felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/FactoryConfigurationAdapterServiceBuilder.java
Wed Sep  8 10:09:38 2010
@@ -22,7 +22,7 @@ import java.util.Dictionary;
 import java.util.List;
 
 import org.apache.felix.dm.DependencyManager;
-import org.apache.felix.dm.Service;
+import org.apache.felix.dm.Component;
 import org.osgi.framework.Bundle;
 
 public class FactoryConfigurationAdapterServiceBuilder extends ServiceComponentBuilder
@@ -45,7 +45,7 @@ public class FactoryConfigurationAdapter
         String[] provides = srvMeta.getStrings(Params.provides, null);
         Dictionary<String, Object> properties = srvMeta.getDictionary(Params.properties,
null);
         boolean propagate = "true".equals(srvMeta.getString(Params.propagate, "false"));
-        Service srv = dm.createFactoryConfigurationAdapterService(factoryPid, updated, propagate);
+        Component srv = dm.createFactoryConfigurationAdapterService(factoryPid, updated,
propagate);
         srv.setInterface(provides, properties);
         String factoryMethod = srvMeta.getString(Params.factoryMethod, null);
         if (factoryMethod == null)

Modified: felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/FactorySet.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/FactorySet.java?rev=994967&r1=994966&r2=994967&view=diff
==============================================================================
--- felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/FactorySet.java
(original)
+++ felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/FactorySet.java
Wed Sep  8 10:09:38 2010
@@ -29,7 +29,7 @@ import java.util.concurrent.ConcurrentHa
 
 import org.apache.felix.dm.Dependency;
 import org.apache.felix.dm.DependencyManager;
-import org.apache.felix.dm.Service;
+import org.apache.felix.dm.Component;
 import org.osgi.framework.Bundle;
 import org.osgi.service.log.LogService;
 
@@ -341,7 +341,7 @@ public class FactorySet extends Abstract
             try
             {
                 // Create the Service / impl
-                Service s = m_dm.createService();
+                Component s = m_dm.createComponent();
                 Class implClass = m_bundle.loadClass(m_srvMeta.getString(Params.impl));
                 String factoryMethod = m_srvMeta.getString(Params.factoryMethod, null);
                 if (factoryMethod == null)
@@ -418,7 +418,7 @@ public class FactorySet extends Abstract
             if (m_provide != null)
             {
                 Dictionary settings = mergeSettings(m_serviceProperties, configuration);
-                ((Service) service).setServiceProperties(settings);
+                ((Component) service).setServiceProperties(settings);
             }
         }
     }
@@ -430,7 +430,7 @@ public class FactorySet extends Abstract
         Object service = m_services.remove(serviceKey);
         if (service != null && service != SERVICE_CREATING)
         {
-            m_dm.remove((Service) service);
+            m_dm.remove((Component) service);
         }
     }
 
@@ -440,9 +440,9 @@ public class FactorySet extends Abstract
         {
             for (Object service: m_services.values())
             {
-                if (service instanceof Service)
+                if (service instanceof Component)
                 {
-                    m_dm.remove((Service) service);
+                    m_dm.remove((Component) service);
                 }
             }
         }

Modified: felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ResourceAdapterServiceBuilder.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ResourceAdapterServiceBuilder.java?rev=994967&r1=994966&r2=994967&view=diff
==============================================================================
--- felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ResourceAdapterServiceBuilder.java
(original)
+++ felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ResourceAdapterServiceBuilder.java
Wed Sep  8 10:09:38 2010
@@ -22,7 +22,7 @@ import java.util.Dictionary;
 import java.util.List;
 
 import org.apache.felix.dm.DependencyManager;
-import org.apache.felix.dm.Service;
+import org.apache.felix.dm.Component;
 import org.osgi.framework.Bundle;
 
 public class ResourceAdapterServiceBuilder extends ServiceComponentBuilder
@@ -45,7 +45,7 @@ public class ResourceAdapterServiceBuild
         Dictionary<String, Object> properties = srvMeta.getDictionary(Params.properties,
null);
         boolean propagate = "true".equals(srvMeta.getString(Params.propagate, "false"));
         String changed = srvMeta.getString(Params.changed, null /* no change callback if
not specified explicitly */);
-        Service srv = dm.createResourceAdapterService(filter, propagate, null, changed);
+        Component srv = dm.createResourceAdapterService(filter, propagate, null, changed);
         srv.setInterface(provides, properties);
         String factoryMethod = srvMeta.getString(Params.factoryMethod, null);
         if (factoryMethod == null)

Modified: felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceBuilder.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceBuilder.java?rev=994967&r1=994966&r2=994967&view=diff
==============================================================================
--- felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceBuilder.java
(original)
+++ felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceBuilder.java
Wed Sep  8 10:09:38 2010
@@ -24,7 +24,7 @@ import java.util.List;
 import java.util.Set;
 
 import org.apache.felix.dm.DependencyManager;
-import org.apache.felix.dm.Service;
+import org.apache.felix.dm.Component;
 import org.osgi.framework.Bundle;
 import org.osgi.service.log.LogService;
 
@@ -43,7 +43,7 @@ public class ServiceBuilder extends Serv
     public void buildService(MetaData srvMeta, List<MetaData> depsMeta, Bundle b, DependencyManager
dm)
         throws Exception
     {
-        Service service = dm.createService();
+        Component service = dm.createComponent();
         String factory = srvMeta.getString(Params.factorySet, null);
 
         // Check if we must provide a Set Factory.

Modified: felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceComponentBuilder.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceComponentBuilder.java?rev=994967&r1=994966&r2=994967&view=diff
==============================================================================
--- felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceComponentBuilder.java
(original)
+++ felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceComponentBuilder.java
Wed Sep  8 10:09:38 2010
@@ -24,7 +24,7 @@ import java.util.List;
 
 import org.apache.felix.dm.Dependency;
 import org.apache.felix.dm.DependencyManager;
-import org.apache.felix.dm.Service;
+import org.apache.felix.dm.Component;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.service.log.LogService;
@@ -51,7 +51,7 @@ public abstract class ServiceComponentBu
     /**
      * Set common Service parameters, if provided from our Component descriptor
      */
-    protected void setCommonServiceParams(Service service, MetaData serviceMetaData)
+    protected void setCommonServiceParams(Component service, MetaData serviceMetaData)
         throws Exception
     {
         String init = serviceMetaData.getString(Params.init, null);
@@ -71,7 +71,7 @@ public abstract class ServiceComponentBu
      * handled differently, and are managed by the ServiceLifecycleHandler class.
      * @throws Exception 
      */
-    protected static void addUnamedDependencies(Bundle b, DependencyManager dm, Service s,

+    protected static void addUnamedDependencies(Bundle b, DependencyManager dm, Component
s, 
                                                 MetaData srvMeta, List<MetaData> depsMeta)

         throws Exception
     {

Modified: felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceLifecycleHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceLifecycleHandler.java?rev=994967&r1=994966&r2=994967&view=diff
==============================================================================
--- felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceLifecycleHandler.java
(original)
+++ felix/trunk/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceLifecycleHandler.java
Wed Sep  8 10:09:38 2010
@@ -36,7 +36,7 @@ import org.apache.felix.dm.Configuration
 import org.apache.felix.dm.Dependency;
 import org.apache.felix.dm.DependencyManager;
 import org.apache.felix.dm.ResourceDependency;
-import org.apache.felix.dm.Service;
+import org.apache.felix.dm.Component;
 import org.apache.felix.dm.ServiceDependency;
 import org.apache.felix.dm.TemporalServiceDependency;
 import org.osgi.framework.Bundle;
@@ -118,7 +118,7 @@ public class ServiceLifecycleHandler
      * @param srvMeta The Service MetaData
      * @param depMeta The Dependencies MetaData
      */
-    public ServiceLifecycleHandler(Service srv, Bundle srvBundle, DependencyManager dm,
+    public ServiceLifecycleHandler(Component srv, Bundle srvBundle, DependencyManager dm,
                                    MetaData srvMeta, List<MetaData> depMeta)
     {
         m_srvMeta = srvMeta;
@@ -138,7 +138,7 @@ public class ServiceLifecycleHandler
      * @param service The Annotated Service
      */
     @SuppressWarnings("unchecked")
-    public void init(Service service)
+    public void init(Component service)
         throws Exception
     {
         Object serviceInstance = service.getService();
@@ -225,7 +225,7 @@ public class ServiceLifecycleHandler
      * Such extra properties takes precedence over existing service properties.
      */
     @SuppressWarnings("unchecked")
-    public void start(Service service)
+    public void start(Component service)
         throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
     {
         // Check if some extra service properties are returned by start method.
@@ -288,7 +288,7 @@ public class ServiceLifecycleHandler
      * Handles the Service's stop lifecycle callback. We just invoke the service "stop" callback
on 
      * the service instance, as well as on all eventual service composites.
      */
-    public void stop(Service service)
+    public void stop(Component service)
         throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
     {
         callbackComposites(service, m_stop);
@@ -298,7 +298,7 @@ public class ServiceLifecycleHandler
      * Handles the Service's destroy lifecycle callback. We just invoke the service "destroy"
callback on 
      * the service instance, as well as on all eventual service composites.
      */
-    public void destroy(Service service)
+    public void destroy(Component service)
         throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
     {
         callbackComposites(service, m_destroy);
@@ -307,7 +307,7 @@ public class ServiceLifecycleHandler
     /**
      * Invoke a callback on all Service compositions.
      */
-    private void callbackComposites(Service service, String callback)
+    private void callbackComposites(Component service, String callback)
         throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
     {
         Object serviceInstance = service.getService();
@@ -321,7 +321,7 @@ public class ServiceLifecycleHandler
     /**
      * Invoke a callback on an Object instance.
      */
-    private Object invokeMethod(Object serviceInstance, String method, DependencyManager
dm, Service service)
+    private Object invokeMethod(Object serviceInstance, String method, DependencyManager
dm, Component service)
         throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
     {
         if (method != null)
@@ -330,7 +330,7 @@ public class ServiceLifecycleHandler
             {
                 return InvocationUtil.invokeCallbackMethod(
                                                            serviceInstance, method,
-                                                           new Class[][] { { Service.class
}, {} },
+                                                           new Class[][] { { Component.class
}, {} },
                                                            new Object[][] { { service },
{} }
                     );
             }



Mime
View raw message