incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1357150 - in /sling/trunk/samples: espblog/ espblog/src/main/java/org/apache/sling/samples/espblog/internal/ path-based-rtp/ path-based-rtp/src/main/java/org/apache/sling/samples/pathbasedrtp/ post-servlet-extensions/ post-servlet-extensio...
Date Wed, 04 Jul 2012 08:11:51 GMT
Author: cziegeler
Date: Wed Jul  4 08:11:49 2012
New Revision: 1357150

URL: http://svn.apache.org/viewvc?rev=1357150&view=rev
Log:
SLING-2363 : Replace JavaDoc SCR annotations with Java SCR annotations

Modified:
    sling/trunk/samples/espblog/pom.xml
    sling/trunk/samples/espblog/src/main/java/org/apache/sling/samples/espblog/internal/ThumbnailGenerator.java
    sling/trunk/samples/path-based-rtp/pom.xml
    sling/trunk/samples/path-based-rtp/src/main/java/org/apache/sling/samples/pathbasedrtp/PathBasedResourceDecorator.java
    sling/trunk/samples/post-servlet-extensions/pom.xml
    sling/trunk/samples/post-servlet-extensions/src/main/java/org/apache/sling/samples/postservletextensions/internal/LinkOperation.java
    sling/trunk/samples/post-servlet-extensions/src/main/java/org/apache/sling/samples/postservletextensions/internal/LinkProcessor.java
    sling/trunk/samples/simple-demo/pom.xml
    sling/trunk/samples/simple-demo/src/main/java/org/apache/sling/sample/Navigation.java
    sling/trunk/samples/simple-demo/src/main/java/org/apache/sling/sample/filter/ZipFilter.java
    sling/trunk/samples/webloader/service/pom.xml
    sling/trunk/samples/webloader/service/src/main/java/org/apache/sling/samples/webloader/internal/WebLoaderImpl.java

Modified: sling/trunk/samples/espblog/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/samples/espblog/pom.xml?rev=1357150&r1=1357149&r2=1357150&view=diff
==============================================================================
--- sling/trunk/samples/espblog/pom.xml (original)
+++ sling/trunk/samples/espblog/pom.xml Wed Jul  4 08:11:49 2012
@@ -94,6 +94,10 @@
       <artifactId>slf4j-api</artifactId>
       <scope>provided</scope>
     </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+        </dependency>
   </dependencies>
   
 </project>

Modified: sling/trunk/samples/espblog/src/main/java/org/apache/sling/samples/espblog/internal/ThumbnailGenerator.java
URL: http://svn.apache.org/viewvc/sling/trunk/samples/espblog/src/main/java/org/apache/sling/samples/espblog/internal/ThumbnailGenerator.java?rev=1357150&r1=1357149&r2=1357150&view=diff
==============================================================================
--- sling/trunk/samples/espblog/src/main/java/org/apache/sling/samples/espblog/internal/ThumbnailGenerator.java
(original)
+++ sling/trunk/samples/espblog/src/main/java/org/apache/sling/samples/espblog/internal/ThumbnailGenerator.java
Wed Jul  4 08:11:49 2012
@@ -39,6 +39,9 @@ import javax.jcr.observation.EventIterat
 import javax.jcr.observation.EventListener;
 import javax.jcr.observation.ObservationManager;
 
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
 import org.apache.sling.jcr.api.SlingRepository;
 import org.osgi.service.component.ComponentContext;
 import org.slf4j.Logger;
@@ -48,20 +51,18 @@ import org.slf4j.LoggerFactory;
  * Observe the espblog content for changes, and generate
  * thumbnails when images are added.
  *
- * @scr.component immediate="true" metatype="false"
- * @scr.property name="service.description" value="Sling ESP blog sample thumbnails generator"
- * @scr.property name="service.vendor" value="Apache Software Foundation"
- *
  */
+@Component(immediate=true)
+@Property(name="service.description", value="Sling ESP blog sample thumbnails generator")
 public class ThumbnailGenerator implements EventListener {
 
     private Session session;
     private ObservationManager observationManager;
 
-	/** @scr.reference */
+	@Reference
 	private SlingRepository repository;
 
-    /** @scr.property value="/content/espblog" */
+    @Property(value="/content/espblog")
     private static final String CONTENT_PATH_PROPERTY = "content.path";
 
 	private static final Logger log = LoggerFactory

Modified: sling/trunk/samples/path-based-rtp/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/samples/path-based-rtp/pom.xml?rev=1357150&r1=1357149&r2=1357150&view=diff
==============================================================================
--- sling/trunk/samples/path-based-rtp/pom.xml (original)
+++ sling/trunk/samples/path-based-rtp/pom.xml Wed Jul  4 08:11:49 2012
@@ -130,6 +130,10 @@
             <artifactId>slf4j-simple</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+        </dependency>
 
     </dependencies>
 </project>

Modified: sling/trunk/samples/path-based-rtp/src/main/java/org/apache/sling/samples/pathbasedrtp/PathBasedResourceDecorator.java
URL: http://svn.apache.org/viewvc/sling/trunk/samples/path-based-rtp/src/main/java/org/apache/sling/samples/pathbasedrtp/PathBasedResourceDecorator.java?rev=1357150&r1=1357149&r2=1357150&view=diff
==============================================================================
--- sling/trunk/samples/path-based-rtp/src/main/java/org/apache/sling/samples/pathbasedrtp/PathBasedResourceDecorator.java
(original)
+++ sling/trunk/samples/path-based-rtp/src/main/java/org/apache/sling/samples/pathbasedrtp/PathBasedResourceDecorator.java
Wed Jul  4 08:11:49 2012
@@ -24,6 +24,10 @@ import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.servlet.http.HttpServletRequest;
 
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.PropertyUnbounded;
+import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceDecorator;
 import org.apache.sling.api.resource.ResourceWrapper;
@@ -41,12 +45,10 @@ import org.slf4j.LoggerFactory;
  *  mapping applies, and "2" is the (1-based) index of the path component to
  *  use as the resource type.
  *
- * @scr.component immediate="true" label="%defaultRtp.name"
- *                description="%defaultRtp.description"
- * @scr.property name="service.vendor" value="The Apache Software Foundation"
- * @scr.property name="service.description" value="Sling Sample Resource Decorator"
- * @scr.service
  */
+@Component(metatype=true, label="%defaultRtp.name", description="%defaultRtp.description")
+@Service
+@Property(name="service.description", value="Sling Sample Resource Decorator")
 public class PathBasedResourceDecorator implements ResourceDecorator {
 
     /**
@@ -54,10 +56,8 @@ public class PathBasedResourceDecorator 
      *  specify the use of path component 2 for the /content path, and add a similar
      *  definition for the /sling-test-pbrt path that is used in integration testing.
      *
-     * @scr.property
-     *  values.1="/content:2"
-     *  values.2="/sling-test-pbrt:2"
      */
+    @Property(value={"/content:2", "/sling-test-pbrt:2"}, unbounded=PropertyUnbounded.ARRAY)
     private static final String PROP_PATH_MAPPING = "path.mapping";
 
     private final Logger log = LoggerFactory.getLogger(getClass());

Modified: sling/trunk/samples/post-servlet-extensions/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/samples/post-servlet-extensions/pom.xml?rev=1357150&r1=1357149&r2=1357150&view=diff
==============================================================================
--- sling/trunk/samples/post-servlet-extensions/pom.xml (original)
+++ sling/trunk/samples/post-servlet-extensions/pom.xml Wed Jul  4 08:11:49 2012
@@ -110,6 +110,10 @@
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.compendium</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+        </dependency>
         
     </dependencies>
 </project>

Modified: sling/trunk/samples/post-servlet-extensions/src/main/java/org/apache/sling/samples/postservletextensions/internal/LinkOperation.java
URL: http://svn.apache.org/viewvc/sling/trunk/samples/post-servlet-extensions/src/main/java/org/apache/sling/samples/postservletextensions/internal/LinkOperation.java?rev=1357150&r1=1357149&r2=1357150&view=diff
==============================================================================
--- sling/trunk/samples/post-servlet-extensions/src/main/java/org/apache/sling/samples/postservletextensions/internal/LinkOperation.java
(original)
+++ sling/trunk/samples/post-servlet-extensions/src/main/java/org/apache/sling/samples/postservletextensions/internal/LinkOperation.java
Wed Jul  4 08:11:49 2012
@@ -20,27 +20,24 @@ import java.util.List;
 
 import javax.jcr.Item;
 import javax.jcr.Node;
-import javax.jcr.Property;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
-import javax.jcr.Value;
 
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.request.RequestParameter;
-import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.servlets.HtmlResponse;
 import org.apache.sling.servlets.post.AbstractSlingPostOperation;
 import org.apache.sling.servlets.post.Modification;
-import org.apache.sling.servlets.post.SlingPostOperation;
-import org.apache.sling.servlets.post.SlingPostProcessor;
 
 /**
  * This operation allows to create links between nodes.
- * 
- * @scr.component metatype="no" immediate="true"
- * @scr.service interface="org.apache.sling.servlets.post.SlingPostOperation"
- * @scr.property name="sling.post.operation" value="link"
+ *
  */
+@Component
+@Service(value=org.apache.sling.servlets.post.SlingPostOperation.class)
+@org.apache.felix.scr.annotations.Property(name="sling.post.operation", value="link")
 public class LinkOperation extends AbstractSlingPostOperation {
 
     public final LinkHelper linkHelper = new LinkHelper();

Modified: sling/trunk/samples/post-servlet-extensions/src/main/java/org/apache/sling/samples/postservletextensions/internal/LinkProcessor.java
URL: http://svn.apache.org/viewvc/sling/trunk/samples/post-servlet-extensions/src/main/java/org/apache/sling/samples/postservletextensions/internal/LinkProcessor.java?rev=1357150&r1=1357149&r2=1357150&view=diff
==============================================================================
--- sling/trunk/samples/post-servlet-extensions/src/main/java/org/apache/sling/samples/postservletextensions/internal/LinkProcessor.java
(original)
+++ sling/trunk/samples/post-servlet-extensions/src/main/java/org/apache/sling/samples/postservletextensions/internal/LinkProcessor.java
Wed Jul  4 08:11:49 2012
@@ -22,6 +22,9 @@ import javax.jcr.Item;
 import javax.jcr.Node;
 import javax.jcr.Session;
 
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.request.RequestParameter;
 import org.apache.sling.servlets.post.Modification;
@@ -30,20 +33,20 @@ import org.apache.sling.servlets.post.Sl
 
 /**
  * This processor allows to create links between nodes.
- * 
- * @scr.component metatype="no" immediate="true"
- * @scr.service interface="org.apache.sling.servlets.post.SlingPostProcessor"
- * @scr.property name="sling.post.processor" value="link"
+ *
  */
+@Component
+@Service(value=SlingPostProcessor.class)
+@Property(name="sling.post.processor", value="link")
 public class LinkProcessor implements SlingPostProcessor {
 
 	public final LinkHelper linkHelper = new LinkHelper();
-	
+
 	public void process(SlingHttpServletRequest request,
 			List<Modification> changes) throws Exception {
 
 		Session session = request.getResourceResolver().adaptTo(Session.class);
-		
+
 		RequestParameter linkParam = request.getRequestParameter(":link");
 		if (linkParam != null){
 			String linkPath = linkParam.getString();
@@ -53,7 +56,7 @@ public class LinkProcessor implements Sl
 				// is it possible to add the response to the method header ?
 				String resourcePath = changes.get(0).getSource();
 				Node source = (Node) session.getItem(resourcePath);
-				
+
 				// create a symetric link
 				if (session.itemExists(linkPath)) {
 					Item targetItem = session.getItem(linkPath);
@@ -63,7 +66,7 @@ public class LinkProcessor implements Sl
 				}
 			}
 		}
-		
+
 
 	}
 }

Modified: sling/trunk/samples/simple-demo/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/samples/simple-demo/pom.xml?rev=1357150&r1=1357149&r2=1357150&view=diff
==============================================================================
--- sling/trunk/samples/simple-demo/pom.xml (original)
+++ sling/trunk/samples/simple-demo/pom.xml Wed Jul  4 08:11:49 2012
@@ -173,5 +173,9 @@
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.core</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+        </dependency>
     </dependencies>
 </project>

Modified: sling/trunk/samples/simple-demo/src/main/java/org/apache/sling/sample/Navigation.java
URL: http://svn.apache.org/viewvc/sling/trunk/samples/simple-demo/src/main/java/org/apache/sling/sample/Navigation.java?rev=1357150&r1=1357149&r2=1357150&view=diff
==============================================================================
--- sling/trunk/samples/simple-demo/src/main/java/org/apache/sling/sample/Navigation.java
(original)
+++ sling/trunk/samples/simple-demo/src/main/java/org/apache/sling/sample/Navigation.java
Wed Jul  4 08:11:49 2012
@@ -24,6 +24,10 @@ import java.util.Iterator;
 
 import javax.servlet.ServletException;
 
+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.Service;
 import org.apache.sling.api.SlingConstants;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
@@ -36,13 +40,14 @@ import org.apache.sling.api.servlets.Sli
  * considered a "page" if the Content object is an instance of the
  * {@link SamplePage} class.
  *
- * @scr.component immediate="true" metatype="no"
- * @scr.property name="service.description" value="Sample Navigation Component"
- * @scr.property name="service.vendor" value="The Apache Software Foundation"
- * @scr.property name="sling.servlet.resourceTypes" value="sling/sample.navigation"
- * @scr.property name="sling.servlet.methods" value="html"
- * @scr.service interface="javax.servlet.Servlet"
  */
+@Component
+@Service(value=javax.servlet.Servlet.class)
+@Properties({
+    @Property(name="service.description", value="Sample Navigation Component"),
+    @Property(name="sling.servlet.resourceTypes", value="sling/sample.navigation"),
+    @Property(name="sling.servlet.methods", value="html")
+})
 public class Navigation extends SlingSafeMethodsServlet {
 
     public static final String RESOURCE_TYPE = "sling/sample.navigation";

Modified: sling/trunk/samples/simple-demo/src/main/java/org/apache/sling/sample/filter/ZipFilter.java
URL: http://svn.apache.org/viewvc/sling/trunk/samples/simple-demo/src/main/java/org/apache/sling/sample/filter/ZipFilter.java?rev=1357150&r1=1357149&r2=1357150&view=diff
==============================================================================
--- sling/trunk/samples/simple-demo/src/main/java/org/apache/sling/sample/filter/ZipFilter.java
(original)
+++ sling/trunk/samples/simple-demo/src/main/java/org/apache/sling/sample/filter/ZipFilter.java
Wed Jul  4 08:11:49 2012
@@ -38,6 +38,10 @@ import javax.servlet.ServletOutputStream
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 
+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.Service;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
 import org.apache.sling.api.wrappers.SlingHttpServletResponseWrapper;
@@ -61,13 +65,14 @@ import org.apache.sling.engine.RequestUt
  * and in fact even slows response time down !!
  * </ul>
  *
- * @scr.component metatype="no" enabled="no"
- * @scr.property name="service.description" value="Sample Request Filter"
- * @scr.property name="service.vendor" value="The Apache Software Foundation"
- * @scr.property name="filter.scope" value="request" private="true"
- * @scr.property name="filter.order" value="-2147483648" type="Integer" private="true"
- * @scr.service
  */
+@Component(enabled=false)
+@Service
+@Properties({
+    @Property(name="service.description", value="Sample Request Filter"),
+    @Property(name="filter.scope", value="request", propertyPrivate=true),
+    @Property(name="filter.order", intValue=-2147483648, propertyPrivate=true)
+})
 public class ZipFilter implements Filter {
 
     /**

Modified: sling/trunk/samples/webloader/service/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/samples/webloader/service/pom.xml?rev=1357150&r1=1357149&r2=1357150&view=diff
==============================================================================
--- sling/trunk/samples/webloader/service/pom.xml (original)
+++ sling/trunk/samples/webloader/service/pom.xml Wed Jul  4 08:11:49 2012
@@ -108,5 +108,9 @@
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+        </dependency>
     </dependencies>
 </project>

Modified: sling/trunk/samples/webloader/service/src/main/java/org/apache/sling/samples/webloader/internal/WebLoaderImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/samples/webloader/service/src/main/java/org/apache/sling/samples/webloader/internal/WebLoaderImpl.java?rev=1357150&r1=1357149&r2=1357150&view=diff
==============================================================================
--- sling/trunk/samples/webloader/service/src/main/java/org/apache/sling/samples/webloader/internal/WebLoaderImpl.java
(original)
+++ sling/trunk/samples/webloader/service/src/main/java/org/apache/sling/samples/webloader/internal/WebLoaderImpl.java
Wed Jul  4 08:11:49 2012
@@ -21,47 +21,41 @@ 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.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.commons.mime.MimeTypeService;
+import org.apache.sling.jcr.api.SlingRepository;
 import org.apache.sling.samples.webloader.Webloader;
 import org.apache.sling.samples.webloader.WebloaderJobStatus;
-import org.apache.sling.jcr.api.SlingRepository;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-/** Webloader implementation, manages WebloaderJobs
- *  
- * @scr.service
- *
- * @scr.component
- *  immediate="true"
- *  metatype="no"
- *
- * @scr.property
- *  name="service.description"
- *  value="Sling Webloader service"
- *
- * @scr.property
- *  name="service.vendor"
- *  value="The Apache Software Foundation"
+/**
+ * Webloader implementation, manages WebloaderJobs
  *
  */
+@Component(immediate=true)
+@Service
+@Property(name="service.description", value="Sling Webloader service")
 public class WebLoaderImpl implements Webloader {
-    
+
     private static final Logger log = LoggerFactory.getLogger(WebLoaderImpl.class);
-    
+
     private final Map<String, WebloaderJob> jobs = new HashMap<String, WebloaderJob>();
-    
-    /** @scr.reference */
+
+    @Reference
     private SlingRepository repository;
-    
-    /** @scr.reference */
+
+    @Reference
     private MimeTypeService mimeTypeService;
 
     /** @inheritDoc */
-    public String createJob(String webQuery, String storagePath, String 
+    public String createJob(String webQuery, String storagePath, String
             fileExtensions, int maxDocsToRetrieve, int maxDocSizeInKb) {
         deleteFinishedJobs();
-        final WebloaderJob j = new WebloaderJob(repository, mimeTypeService, 
+        final WebloaderJob j = new WebloaderJob(repository, mimeTypeService,
                 webQuery, storagePath, fileExtensions, maxDocsToRetrieve, maxDocSizeInKb);
         synchronized (jobs) {
             jobs.put(j.getJobId(), j);
@@ -83,7 +77,7 @@ public class WebLoaderImpl implements We
                 toDelete.add(j);
             }
         }
-        
+
         synchronized (jobs) {
             for(WebloaderJob j : toDelete) {
                 jobs.remove(j.getJobId());



Mime
View raw message