incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r1209746 - in /sling/trunk/bundles/extensions/fsresource: pom.xml src/main/java/org/apache/sling/fsprovider/internal/FsResourceProvider.java
Date Fri, 02 Dec 2011 22:32:06 GMT
Author: justin
Date: Fri Dec  2 22:32:06 2011
New Revision: 1209746

URL: http://svn.apache.org/viewvc?rev=1209746&view=rev
Log:
SLING-2314 - applying patch from Stefan Seifert to switch annotation style on FSResourceProvider.
Thanks for the patch!

Modified:
    sling/trunk/bundles/extensions/fsresource/pom.xml
    sling/trunk/bundles/extensions/fsresource/src/main/java/org/apache/sling/fsprovider/internal/FsResourceProvider.java

Modified: sling/trunk/bundles/extensions/fsresource/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/fsresource/pom.xml?rev=1209746&r1=1209745&r2=1209746&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/fsresource/pom.xml (original)
+++ sling/trunk/bundles/extensions/fsresource/pom.xml Fri Dec  2 22:32:06 2011
@@ -124,5 +124,10 @@
             <version>0.0.1-SNAPSHOT</version>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
 </project>

Modified: sling/trunk/bundles/extensions/fsresource/src/main/java/org/apache/sling/fsprovider/internal/FsResourceProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/fsresource/src/main/java/org/apache/sling/fsprovider/internal/FsResourceProvider.java?rev=1209746&r1=1209745&r2=1209746&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/fsresource/src/main/java/org/apache/sling/fsprovider/internal/FsResourceProvider.java
(original)
+++ sling/trunk/bundles/extensions/fsresource/src/main/java/org/apache/sling/fsprovider/internal/FsResourceProvider.java
Fri Dec  2 22:32:06 2011
@@ -28,6 +28,14 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.servlet.http.HttpServletRequest;
 
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.ConfigurationPolicy;
+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.resource.Resource;
 import org.apache.sling.api.resource.ResourceProvider;
 import org.apache.sling.api.resource.ResourceResolver;
@@ -44,20 +52,21 @@ import org.osgi.service.event.EventAdmin
  * resource tree where resources are provided ({@link ResourceProvider#ROOTS})
  * and the file system path from where files and folders are mapped into the
  * resource ({@link #PROP_PROVIDER_FILE}).
- *
- * @scr.component name="org.apache.sling.fsprovider.internal.FsResourceProvider"
- *                label="%resource.resolver.name"
- *                description="%resource.resolver.description"
- *                configurationFactory="true"
- *                policy="require"
- * @scr.service interface="ResourceProvider"
- * @scr.property name="service.description" value="Sling Filesystem Resource
- *               Provider"
- * @scr.property name="service.vendor" value="The Apache Software Foundation"
- * @scr.property nameRef="ResourceProvider.ROOTS"
- * @scr.property nameRef="PROP_PROVIDER_FILE"
- * @scr.property nameRef="PROP_PROVIDER_CHECKINTERVAL" valueRef="DEFAULT_CHECKINTERVAL"
  */
+@Component(
+    name="org.apache.sling.fsprovider.internal.FsResourceProvider",
+    label="%resource.resolver.name",
+    description="%resource.resolver.description",
+    configurationFactory=true,
+    policy=ConfigurationPolicy.REQUIRE,
+    metatype=true
+)
+@Service(ResourceProvider.class)
+@Properties({
+    @Property(name="service.description", value="Sling Filesystem Resource Provider"),
+    @Property(name="service.vendor", value="The Apache Software Foundation"),
+    @Property(name=ResourceProvider.ROOTS)    
+})
 public class FsResourceProvider implements ResourceProvider {
 
     /**
@@ -65,15 +74,17 @@ public class FsResourceProvider implemen
      * files and folders mapped into the resource tree (value is
      * "provider.file").
      */
+    @Property
     public static final String PROP_PROVIDER_FILE = "provider.file";
 
     /**
      * The name of the configuration property providing the check interval
      * for file changes (value is "provider.checkinterval").
      */
+    @Property(longValue=FsResourceProvider.DEFAULT_CHECKINTERVAL)
     public static final String PROP_PROVIDER_CHECKINTERVAL = "provider.checkinterval";
 
-    public static long DEFAULT_CHECKINTERVAL = 1000;
+    public static final long DEFAULT_CHECKINTERVAL = 1000;
 
     // The location in the resource tree where the resources are mapped
     private String providerRoot;
@@ -87,7 +98,7 @@ public class FsResourceProvider implemen
     /** The monitor to detect file changes. */
     private FileMonitor monitor;
 
-    /** @scr.reference cardinality="0..1" policy="dynamic" */
+    @Reference(cardinality=ReferenceCardinality.OPTIONAL_UNARY, policy=ReferencePolicy.DYNAMIC)
     private EventAdmin eventAdmin;
 
     /**



Mime
View raw message