incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r1201062 - in /sling/trunk/bundles/extensions/adapter: pom.xml src/main/java/org/apache/sling/adapter/internal/AdapterManagerImpl.java
Date Fri, 11 Nov 2011 21:40:33 GMT
Author: justin
Date: Fri Nov 11 21:40:32 2011
New Revision: 1201062

URL: http://svn.apache.org/viewvc?rev=1201062&view=rev
Log:
SLING-2209 - replacing javadoc SCR annotations with Java SCR annotations

Modified:
    sling/trunk/bundles/extensions/adapter/pom.xml
    sling/trunk/bundles/extensions/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterManagerImpl.java

Modified: sling/trunk/bundles/extensions/adapter/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/adapter/pom.xml?rev=1201062&r1=1201061&r2=1201062&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/adapter/pom.xml (original)
+++ sling/trunk/bundles/extensions/adapter/pom.xml Fri Nov 11 21:40:32 2011
@@ -111,6 +111,10 @@
             <artifactId>org.osgi.compendium</artifactId>
         </dependency>
         <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+        </dependency>
+        <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
         </dependency>

Modified: sling/trunk/bundles/extensions/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterManagerImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterManagerImpl.java?rev=1201062&r1=1201061&r2=1201062&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterManagerImpl.java
(original)
+++ sling/trunk/bundles/extensions/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterManagerImpl.java
Fri Nov 11 21:40:32 2011
@@ -29,11 +29,19 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Properties;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.apache.felix.scr.annotations.ReferencePolicy;
+import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.api.SlingConstants;
 import org.apache.sling.api.adapter.AdapterFactory;
 import org.apache.sling.api.adapter.AdapterManager;
 import org.apache.sling.api.resource.SyntheticResource;
 import org.apache.sling.commons.osgi.OsgiUtil;
+import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
 import org.osgi.service.component.ComponentContext;
 import org.osgi.service.event.Event;
@@ -46,14 +54,16 @@ import org.slf4j.LoggerFactory;
  * {@link AdapterManager} interface and is registered as a service for that
  * interface to be used by any clients.
  *
- * @scr.component metatype="no" immediate="true"
- * @scr.property name="service.description" value="Sling Adapter Manager"
- * @scr.property name="service.vendor" value="The Apache Software Foundation"
- * @scr.service
- * @scr.reference name="AdapterFactory"
- *                interface="org.apache.sling.api.adapter.AdapterFactory"
- *                cardinality="0..n" policy="dynamic"
  */
+@Component(immediate=true)
+@Service
+@Properties({
+    @Property(name=Constants.SERVICE_DESCRIPTION, value="Sling Adapter Manager"),
+    @Property(name=Constants.SERVICE_VENDOR, value="The Apache Software Foundation")
+    
+})
+@Reference(name="AdapterFactory", referenceInterface=AdapterFactory.class,
+    cardinality=ReferenceCardinality.OPTIONAL_MULTIPLE, policy=ReferencePolicy.DYNAMIC)
 public class AdapterManagerImpl implements AdapterManager {
 
     private Logger log = LoggerFactory.getLogger(getClass());
@@ -94,8 +104,8 @@ public class AdapterManagerImpl implemen
 
     /**
      * The service tracker for the event admin
-     * @scr.reference cardinality="0..1" policy="dynamic"
      */
+    @Reference(cardinality=ReferenceCardinality.OPTIONAL_UNARY, policy=ReferencePolicy.DYNAMIC)
     private EventAdmin eventAdmin;
 
     // ---------- AdapterManager interface -------------------------------------



Mime
View raw message