incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1357132 - in /sling/trunk/contrib/extensions/apt: parser/pom.xml parser/src/main/java/org/apache/sling/apt/parser/internal/SlingAptParserImpl.java servlet/pom.xml servlet/src/main/java/org/apache/sling/apt/servlet/SlingAptServlet.java
Date Wed, 04 Jul 2012 07:45:49 GMT
Author: cziegeler
Date: Wed Jul  4 07:45:48 2012
New Revision: 1357132

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

Modified:
    sling/trunk/contrib/extensions/apt/parser/pom.xml
    sling/trunk/contrib/extensions/apt/parser/src/main/java/org/apache/sling/apt/parser/internal/SlingAptParserImpl.java
    sling/trunk/contrib/extensions/apt/servlet/pom.xml
    sling/trunk/contrib/extensions/apt/servlet/src/main/java/org/apache/sling/apt/servlet/SlingAptServlet.java

Modified: sling/trunk/contrib/extensions/apt/parser/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/apt/parser/pom.xml?rev=1357132&r1=1357131&r2=1357132&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/apt/parser/pom.xml (original)
+++ sling/trunk/contrib/extensions/apt/parser/pom.xml Wed Jul  4 07:45:48 2012
@@ -92,5 +92,9 @@
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+        </dependency>
     </dependencies>
 </project>

Modified: sling/trunk/contrib/extensions/apt/parser/src/main/java/org/apache/sling/apt/parser/internal/SlingAptParserImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/apt/parser/src/main/java/org/apache/sling/apt/parser/internal/SlingAptParserImpl.java?rev=1357132&r1=1357131&r2=1357132&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/apt/parser/src/main/java/org/apache/sling/apt/parser/internal/SlingAptParserImpl.java
(original)
+++ sling/trunk/contrib/extensions/apt/parser/src/main/java/org/apache/sling/apt/parser/internal/SlingAptParserImpl.java
Wed Jul  4 07:45:48 2012
@@ -23,39 +23,38 @@ import java.io.Reader;
 import java.io.Writer;
 import java.util.Map;
 
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Service;
 import org.apache.maven.doxia.module.apt.AptParseException;
 import org.apache.maven.doxia.module.apt.AptParser;
 import org.apache.maven.doxia.sink.Sink;
 import org.apache.sling.apt.parser.SlingAptParseException;
 import org.apache.sling.apt.parser.SlingAptParser;
 
-/** SlingAptParser implementation, provided as an SCR service
- * 
-*   @scr.component metatype="no" 
-*       description="Converts APT documents to HTML format"
-*   @scr.property name="service.vendor" value="The Apache Software Foundation"
-*   @scr.property name="service.description"
-*       value="Sling APT structured text parser"
-*
-*   @scr.service
-*/
-
+/**
+ * SlingAptParser implementation, provided as an SCR service
+ *
+ */
+@Component()
+@Service
+@Property(name="service.description", value="Sling APT structured text parser")
 public class SlingAptParserImpl implements SlingAptParser {
 
     private final MacroResolver macroProvider;
-    
+
     public SlingAptParserImpl() {
         macroProvider = null;
     }
-    
+
     SlingAptParserImpl(MacroResolver mp) {
         macroProvider = mp;
     }
-    
+
     public void parse(Reader input, Writer output) throws IOException, SlingAptParseException
{
         parse(input, output, null);
     }
-    
+
     public void parse(Reader input, Writer output, Map<String, Object> options) throws
IOException, SlingAptParseException {
         final Sink sink = new CustomAptSink(output, options);
         final AptParser parser = new CustomAptParser(macroProvider);

Modified: sling/trunk/contrib/extensions/apt/servlet/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/apt/servlet/pom.xml?rev=1357132&r1=1357131&r2=1357132&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/apt/servlet/pom.xml (original)
+++ sling/trunk/contrib/extensions/apt/servlet/pom.xml Wed Jul  4 07:45:48 2012
@@ -76,5 +76,9 @@
       <groupId>javax.servlet</groupId>
       <artifactId>servlet-api</artifactId>
     </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+        </dependency>
   </dependencies>
 </project>

Modified: sling/trunk/contrib/extensions/apt/servlet/src/main/java/org/apache/sling/apt/servlet/SlingAptServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/apt/servlet/src/main/java/org/apache/sling/apt/servlet/SlingAptServlet.java?rev=1357132&r1=1357131&r2=1357132&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/apt/servlet/src/main/java/org/apache/sling/apt/servlet/SlingAptServlet.java
(original)
+++ sling/trunk/contrib/extensions/apt/servlet/src/main/java/org/apache/sling/apt/servlet/SlingAptServlet.java
Wed Jul  4 07:45:48 2012
@@ -25,6 +25,11 @@ import java.io.Writer;
 
 import javax.servlet.http.HttpServletResponse;
 
+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.Service;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
 import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
@@ -33,50 +38,35 @@ import org.apache.sling.apt.parser.Sling
 /**
 * Parses APT structured text files and renders them in HTML
 *
-* @scr.service
-*  interface="javax.servlet.Servlet"
-*
-* @scr.component
-*  immediate="true"
-*  metatype="no"
-*
-* @scr.property
-*  name="service.description"
-*  value="Sling APT Servlet"
-*
-* @scr.property
-*  name="service.vendor"
-*  value="The Apache Software Foundation"
-*
 * Use this as the default GET servlet for apt requests
-* @scr.property
-*  name="sling.servlet.resourceTypes"
-*  value="sling/servlet/default"
 *
 * TODO for now we have to use this weird extension, added after the
 * full filename. We should add a sling.servlet.contentExtension parameter
 * to the servlet selection mechanism, and use that to tell sling to map
 * an html request to an apt file using this servlet.
-* 
-* @scr.property
-*  name="sling.servlet.extensions"
-*  value="aptml"
+*
 */
-
+@Component
+@Service(value=javax.servlet.Servlet.class)
+@Properties({
+    @Property(name="service.description", value="Sling APT Servlet"),
+    @Property(name="sling.servlet.resourceTypes", value="sling/servlet/default"),
+    @Property(name="sling.servlet.extensions", value="aptml")
+})
 public class SlingAptServlet extends SlingSafeMethodsServlet {
-    
-    /** @scr.reference */
+
+    @Reference
     protected SlingAptParser parser;
-    
+
     protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)
throws IOException {
         final InputStream stream = request.getResource().adaptTo(InputStream.class);
         if(stream == null) {
             response.sendError(
-                HttpServletResponse.SC_BAD_REQUEST, 
+                HttpServletResponse.SC_BAD_REQUEST,
                 "Resource does not adapt to an InputStream: " + request.getResource()
             );
         }
-        
+
         // TODO which encoding to use for input??
         // Should find out from the JCR resource node
         final String encoding = "UTF-8";



Mime
View raw message