This is an automated email from the ASF dual-hosted git repository. rombert pushed a commit to annotated tag org.apache.sling.fsresource-1.1.0 in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-fsresource.git
commit 83092831a05ca9bb68fe02a79ae7317f9bf22aa3 Author: Justin Edelson <[email protected]> AuthorDate: Fri Dec 2 22:32:06 2011 +0000 SLING-2314 - applying patch from Stefan Seifert to switch annotation style on FSResourceProvider. Thanks for the patch! git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/fsresource@1209746 13f79535-47bb-0310-9956-ffa450edef68 --- pom.xml | 5 +++ .../fsprovider/internal/FsResourceProvider.java | 41 ++++++++++++++-------- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/pom.xml b/pom.xml index 1b2ad51..a5fa98a 100644 --- a/pom.xml +++ b/pom.xml @@ -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> diff --git a/src/main/java/org/apache/sling/fsprovider/internal/FsResourceProvider.java b/src/main/java/org/apache/sling/fsprovider/internal/FsResourceProvider.java index 9c8d240..f261e50 100644 --- a/src/main/java/org/apache/sling/fsprovider/internal/FsResourceProvider.java +++ b/src/main/java/org/apache/sling/fsprovider/internal/FsResourceProvider.java @@ -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 implements ResourceProvider { * 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 implements ResourceProvider { /** 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; /** -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
