felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r926396 - in /felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource: ResourceConsumer.java ResourceProvider.java ServiceConsumer.java ServiceInterface.java ServiceProvider.java
Date Mon, 22 Mar 2010 23:29:15 GMT
Author: pderop
Date: Mon Mar 22 23:29:15 2010
New Revision: 926396

URL: http://svn.apache.org/viewvc?rev=926396&view=rev
Log:
added comments

Modified:
    felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceConsumer.java
    felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceProvider.java
    felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceConsumer.java
    felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceInterface.java
    felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceProvider.java

Modified: felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceConsumer.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceConsumer.java?rev=926396&r1=926395&r2=926396&view=diff
==============================================================================
--- felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceConsumer.java
(original)
+++ felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceConsumer.java
Mon Mar 22 23:29:15 2010
@@ -27,6 +27,9 @@ import org.apache.felix.dm.annotation.ap
 import org.apache.felix.dm.resources.Resource;
 import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
 
+/**
+ * A Component which has a resource dependency.
+ */
 @Service
 public class ResourceConsumer
 {

Modified: felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceProvider.java?rev=926396&r1=926395&r2=926396&view=diff
==============================================================================
--- felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceProvider.java
(original)
+++ felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceProvider.java
Mon Mar 22 23:29:15 2010
@@ -34,8 +34,10 @@ import org.apache.felix.dm.resources.Res
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Filter;
 import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
 
+/**
+ * Provides some simple resources.
+ */
 @Service
 public class ResourceProvider
 {
@@ -63,10 +65,15 @@ public class ResourceProvider
                 };
             } };
 
+    /**
+     * Handles a new Resource consumer
+     * @param serviceProperties
+     * @param handler
+     */
     @ServiceDependency(removed = "remove", required=false)
-    public void add(ServiceReference ref, ResourceHandler handler)
+    public void add(Map serviceProperties, ResourceHandler handler)
     {
-        String filterString = (String) ref.getProperty("filter");
+        String filterString = (String) serviceProperties.get("filter");
         Filter filter;
         try
         {
@@ -90,7 +97,11 @@ public class ResourceProvider
         }
     }
 
-    public void remove(ServiceReference ref, ResourceHandler handler)
+    /**
+     * Remove a Resource consumer.
+     * @param handler
+     */
+    public void remove(ResourceHandler handler)
     {
         Filter filter;
         synchronized (m_handlers)
@@ -111,6 +122,10 @@ public class ResourceProvider
         }
     }
 
+    /**
+     * Our component is being destroyed: notify all our registered Resource consumers that
we don't
+     * provide our Resources anymore.
+     */
     @Destroy
     public void destroy()
     {

Modified: felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceConsumer.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceConsumer.java?rev=926396&r1=926395&r2=926396&view=diff
==============================================================================
--- felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceConsumer.java
(original)
+++ felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceConsumer.java
Mon Mar 22 23:29:15 2010
@@ -23,6 +23,10 @@ import org.apache.felix.dm.annotation.ap
 import org.apache.felix.dm.annotation.api.Start;
 import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
 
+/**
+ * A Component with a dependency over the ServiceInterface, which is actually provided
+ * by a ResourceAdapter.
+ */
 @Service
 public class ServiceConsumer
 {

Modified: felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceInterface.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceInterface.java?rev=926396&r1=926395&r2=926396&view=diff
==============================================================================
--- felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceInterface.java
(original)
+++ felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceInterface.java
Mon Mar 22 23:29:15 2010
@@ -18,6 +18,9 @@
 */
 package org.apache.felix.dm.test.bundle.annotation.resource;
 
+/**
+ * A Service provided the ServiceProvider, which is a ResourceAdapter.
+ */
 public interface ServiceInterface extends Runnable
 {
     

Modified: felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceProvider.java?rev=926396&r1=926395&r2=926396&view=diff
==============================================================================
--- felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceProvider.java
(original)
+++ felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceProvider.java
Mon Mar 22 23:29:15 2010
@@ -26,6 +26,9 @@ import org.apache.felix.dm.annotation.ap
 import org.apache.felix.dm.resources.Resource;
 import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
 
+/**
+ * Our ServiceInterface provider, which service is activated by a ResourceAdapter.
+ */
 @ResourceAdapterService(
     filter = "(&(path=/test)(name=test1.txt)(repository=TestRepository))", 
     properties = {@Property(name="foo", value="bar")},



Mime
View raw message