incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1453854 - in /sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets: NamespaceTestServlet.java SelectorServlet.java
Date Thu, 07 Mar 2013 13:19:07 GMT
Author: bdelacretaz
Date: Thu Mar  7 13:19:07 2013
New Revision: 1453854

URL: http://svn.apache.org/r1453854
Log:
SLING-2777 - use SlingServlet for some test servlets

Modified:
    sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/NamespaceTestServlet.java
    sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/SelectorServlet.java

Modified: sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/NamespaceTestServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/NamespaceTestServlet.java?rev=1453854&r1=1453853&r2=1453854&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/NamespaceTestServlet.java
(original)
+++ sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/NamespaceTestServlet.java
Thu Mar  7 13:19:07 2013
@@ -22,10 +22,7 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 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.felix.scr.annotations.sling.SlingServlet;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
 import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
@@ -33,13 +30,9 @@ import org.apache.sling.api.servlets.Sli
 /**
  * Test Servlet which outputs the current namespace mappings.
  */
-@Component(immediate=true, metatype=false)
-@Service(value=javax.servlet.Servlet.class)
-@Properties({
-    @Property(name="service.description", value="NamespaceMapping Test Servlet"),
-    @Property(name="service.vendor", value="The Apache Software Foundation"),
-    @Property(name="sling.servlet.paths", value="/testing/NamespaceTestServlet/output")
-})
+@SlingServlet(
+        paths="/testing/NamespaceTestServlet/output"
+        )
 @SuppressWarnings("serial")
 public class NamespaceTestServlet extends SlingSafeMethodsServlet {
 

Modified: sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/SelectorServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/SelectorServlet.java?rev=1453854&r1=1453853&r2=1453854&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/SelectorServlet.java
(original)
+++ sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/SelectorServlet.java
Thu Mar  7 13:19:07 2013
@@ -16,22 +16,15 @@
  */
 package org.apache.sling.launchpad.testservices.servlets;
 
-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.felix.scr.annotations.sling.SlingServlet;
 
 /** Example/test Sling Servlet registered with two selectors */
-@Component(immediate=true, metatype=false)
-@Service(value=javax.servlet.Servlet.class)
-@Properties({
-    @Property(name="service.description", value="Selector Test Servlet"),
-    @Property(name="service.vendor", value="The Apache Software Foundation"),
-    @Property(name="sling.servlet.resourceTypes", value="sling/servlet/default"),
-    @Property(name="sling.servlet.methods", value={"GET","POST"}),
-    @Property(name="sling.servlet.selectors", value={"TEST_SEL_1","TEST_SEL_2"}),
-    @Property(name="sling.servlet.extensions", value="txt")
-})
+@SlingServlet(
+        resourceTypes="sling/servlet/default",
+        methods={"GET","POST"},
+        selectors={"TEST_SEL_1","TEST_SEL_2"},
+        extensions="txt"
+        )
 @SuppressWarnings("serial")
 public class SelectorServlet extends TestServlet {
 }



Mime
View raw message