incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1074109 - in /sling/trunk/launchpad: test-services-war/ test-services-war/src/main/java/org/apache/sling/launchpad/testservices/war/servlets/ test-services/src/main/java/org/apache/sling/launchpad/testservices/filters/ test-services/src/ma...
Date Thu, 24 Feb 2011 11:01:52 GMT
Author: bdelacretaz
Date: Thu Feb 24 11:01:51 2011
New Revision: 1074109

URL: http://svn.apache.org/viewvc?rev=1074109&view=rev
Log:
SLING-1993 - replace @scr tags with annotations

Modified:
    sling/trunk/launchpad/test-services-war/pom.xml
    sling/trunk/launchpad/test-services-war/src/main/java/org/apache/sling/launchpad/testservices/war/servlets/SelectorServlet.java
    sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/filters/HttpServiceExtFilter.java
    sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/filters/NoPropertyFilter.java
    sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/filters/SlingFilter.java
    sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/filters/TestFilter.java
    sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/jcr/StartupTestContentLoader.java
    sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/jcr/TestNamespaceMapper.java
    sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/scripting/GroovyBindingsValuesProvider.java
    sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/scripting/JSPBindingsValuesProvider.java
    sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/scripting/StandaloneScriptExecutionServlet.java
    sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/scripting/StringBindingsValuesProvider.java
    sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/ExtensionServlet.java
    sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/HtmlDefaultServlet.java
    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/PathsServlet.java
    sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/PrefixServletMinusOne.java
    sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/PrefixServletZero.java
    sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/PutMethodServlet.java
    sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/RequestUriOptingServlet.java
    sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/SelectorServlet.java

Modified: sling/trunk/launchpad/test-services-war/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services-war/pom.xml?rev=1074109&r1=1074108&r2=1074109&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services-war/pom.xml (original)
+++ sling/trunk/launchpad/test-services-war/pom.xml Thu Feb 24 11:01:51 2011
@@ -131,6 +131,12 @@
             <artifactId>org.osgi.compendium</artifactId>
         </dependency>
         <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+            <version>1.4.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
         </dependency>

Modified: sling/trunk/launchpad/test-services-war/src/main/java/org/apache/sling/launchpad/testservices/war/servlets/SelectorServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services-war/src/main/java/org/apache/sling/launchpad/testservices/war/servlets/SelectorServlet.java?rev=1074109&r1=1074108&r2=1074109&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services-war/src/main/java/org/apache/sling/launchpad/testservices/war/servlets/SelectorServlet.java
(original)
+++ sling/trunk/launchpad/test-services-war/src/main/java/org/apache/sling/launchpad/testservices/war/servlets/SelectorServlet.java
Thu Feb 24 11:01:51 2011
@@ -18,26 +18,21 @@
  */
 package org.apache.sling.launchpad.testservices.war.servlets;
 
-/** Example/test Sling Servlet registered with two selectors
- *
- * @scr.component immediate="true" metatype="no"
- * @scr.service interface="javax.servlet.Servlet"
- *
- * @scr.property name="service.description" value="Default Query Servlet"
- * @scr.property name="service.vendor" value="The Apache Software Foundation"
- *
- * Register this servlet for the default resource type and two selectors:
- * @scr.property name="sling.servlet.resourceTypes"
- *               value="sling/servlet/default"
- *
- * @scr.property name="sling.servlet.selectors"
- *               values.1 = "WAR_TEST_SEL_1"
- *               values.2 = "WAR_TEST_SEL_2"
- *
- * @scr.property name="sling.servlet.extensions"
- *               value = "txt"
-*/
+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;
 
+/** 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="Default Query Servlet"),
+    @Property(name="service.vendor", value="The Apache Software Foundation"),
+    @Property(name="sling.servlet.resourceTypes", value="sling/servlet/default"),
+    @Property(name="sling.servlet.selectors", value={"WAR_TEST_SEL_1","WAR_TEST_SEL_2"}),
+    @Property(name="sling.servlet.extensions", value="txt")
+})
 @SuppressWarnings("serial")
 public class SelectorServlet extends TestServlet {
 }
\ No newline at end of file

Modified: sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/filters/HttpServiceExtFilter.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/filters/HttpServiceExtFilter.java?rev=1074109&r1=1074108&r2=1074109&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/filters/HttpServiceExtFilter.java
(original)
+++ sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/filters/HttpServiceExtFilter.java
Thu Feb 24 11:01:51 2011
@@ -16,17 +16,21 @@
  */
 package org.apache.sling.launchpad.testservices.filters;
 
-/** Example/test Filter.
- *
- * @scr.component immediate="true" metatype="no"
- * @scr.service interface="javax.servlet.Filter"
- *
- * @scr.property name="service.description" value="Test HttpService Filter"
- * @scr.property name="service.vendor" value="The Apache Software Foundation"
- *
- * Register this filter with the whiteboard-specific registration property
- * @scr.property name="pattern" value="/.*"
+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;
+
+/** Example/test Filter, registered
+ *  with the whiteboard-specific registration property
  */
+@Component(immediate=true, metatype=false)
+@Service(value=javax.servlet.Filter.class)
+@Properties({
+    @Property(name="service.description", value="Test HttpService Filter"),
+    @Property(name="service.vendor", value="The Apache Software Foundation"),
+    @Property(name="pattern", value="/.*")
+})
 public class HttpServiceExtFilter extends TestFilter {
 
     @Override

Modified: sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/filters/NoPropertyFilter.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/filters/NoPropertyFilter.java?rev=1074109&r1=1074108&r2=1074109&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/filters/NoPropertyFilter.java
(original)
+++ sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/filters/NoPropertyFilter.java
Thu Feb 24 11:01:51 2011
@@ -16,18 +16,19 @@
  */
 package org.apache.sling.launchpad.testservices.filters;
 
-/** Example/test Sling Servlet registered with two extensions
- *
- * @scr.component immediate="true" metatype="no"
- * @scr.service interface="javax.servlet.Filter"
- *
- * @scr.property name="service.description" value="Test Filter"
- * @scr.property name="service.vendor" value="The Apache Software Foundation"
- *
- * @scr.property name="sling.filter.scope" value="request"
- *
- * Register this filter with the no pattern registration properties
- */
+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;
+
+/** Example/test filter */
+@Component(immediate=true, metatype=false)
+@Service(value=javax.servlet.Filter.class)
+@Properties({
+    @Property(name="service.description", value="NoProperty Test Filter"),
+    @Property(name="service.vendor", value="The Apache Software Foundation"),
+    @Property(name="sling.filter.scope", value="request")
+})
 public class NoPropertyFilter extends TestFilter {
 
     @Override

Modified: sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/filters/SlingFilter.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/filters/SlingFilter.java?rev=1074109&r1=1074108&r2=1074109&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/filters/SlingFilter.java
(original)
+++ sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/filters/SlingFilter.java
Thu Feb 24 11:01:51 2011
@@ -16,18 +16,20 @@
  */
 package org.apache.sling.launchpad.testservices.filters;
 
-/** Example/test Sling Servlet registered with two extensions
- *
- * @scr.component immediate="true" metatype="no"
- * @scr.service interface="javax.servlet.Filter"
- * @scr.property name="sling.filter.scope" value="request"
- *
- * @scr.property name="service.description" value="Test Filter"
- * @scr.property name="service.vendor" value="The Apache Software Foundation"
- *
- * Register this filter with the Sling-specific registration property
- * @scr.property name="filter.scope" value="request"
- */
+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;
+
+/** Example/test Filter */
+@Component(immediate=true, metatype=false)
+@Service(value=javax.servlet.Filter.class)
+@Properties({
+    @Property(name="service.description", value="SlingFilter Test Filter"),
+    @Property(name="service.vendor", value="The Apache Software Foundation"),
+    @Property(name="filter.scope", value="request"),
+    @Property(name="sling.filter.scope", value="request")
+})
 public class SlingFilter extends TestFilter {
 
     @Override

Modified: sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/filters/TestFilter.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/filters/TestFilter.java?rev=1074109&r1=1074108&r2=1074109&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/filters/TestFilter.java
(original)
+++ sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/filters/TestFilter.java
Thu Feb 24 11:01:51 2011
@@ -28,9 +28,7 @@ import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-/**
- * Example/test Filter.
- */
+/** Base class for test filters */
 abstract class TestFilter implements Filter {
 
     public void init(FilterConfig filterConfig) throws ServletException {

Modified: sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/jcr/StartupTestContentLoader.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/jcr/StartupTestContentLoader.java?rev=1074109&r1=1074108&r2=1074109&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/jcr/StartupTestContentLoader.java
(original)
+++ sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/jcr/StartupTestContentLoader.java
Thu Feb 24 11:01:51 2011
@@ -20,31 +20,27 @@ import java.io.IOException;
 
 import javax.jcr.RepositoryException;
 
+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.sling.jcr.jackrabbit.server.TestContentLoader;
 import org.osgi.service.component.ComponentContext;
 
 /**
  * Component which loads the JCR test content on startup.
- *
- * @scr.component enabled="false" metatype="no"
- *
- * @scr.property name="service.description" value="Test Content Loader"
- * @scr.property name="service.vendor" value="The Apache Software Foundation"
- *
  */
+@Component(enabled=false, metatype=false)
+@Properties({
+    @Property(name="service.description", value="Test Content Loader"),
+    @Property(name="service.vendor", value="The Apache Software Foundation")
+})
 public class StartupTestContentLoader {
 
-    /** @scr.reference */
+    @Reference
     private TestContentLoader loader;
 
-    // ---------- SCR integration
-
     protected void activate(ComponentContext context) throws RepositoryException, IOException
{
         loader.loadTestContent();
     }
-
-    protected void deactivate(ComponentContext context) {
-        ;
-    }
-
-}
+}
\ No newline at end of file

Modified: sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/jcr/TestNamespaceMapper.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/jcr/TestNamespaceMapper.java?rev=1074109&r1=1074108&r2=1074109&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/jcr/TestNamespaceMapper.java
(original)
+++ sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/jcr/TestNamespaceMapper.java
Thu Feb 24 11:01:51 2011
@@ -19,18 +19,23 @@ package org.apache.sling.launchpad.tests
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
+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.jcr.api.NamespaceMapper;
 
 /**
  * Test Implementation of NamespaceMapper
- *
- * @scr.component immediate="true" metatype="no"
- * @scr.service interface="org.apache.sling.jcr.api.NamespaceMapper"
- *
- * @scr.property name="service.description" value="Test NamespaceMapper"
- * @scr.property name="service.vendor" value="The Apache Software Foundation"
- *
  */
+@Component(immediate=true, metatype=false)
+@Service(value=org.apache.sling.jcr.api.NamespaceMapper.class)
+@Properties({
+    @Property(name="service.description", value="Test NamespaceMapper"),
+    @Property(name="service.vendor", value="The Apache Software Foundation"),
+    @Property(name="filter.scope", value="request"),
+    @Property(name="sling.filter.scope", value="request")
+})
 public class TestNamespaceMapper implements NamespaceMapper {
 
     public void defineNamespacePrefixes(Session session) throws RepositoryException {

Modified: sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/scripting/GroovyBindingsValuesProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/scripting/GroovyBindingsValuesProvider.java?rev=1074109&r1=1074108&r2=1074109&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/scripting/GroovyBindingsValuesProvider.java
(original)
+++ sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/scripting/GroovyBindingsValuesProvider.java
Thu Feb 24 11:01:51 2011
@@ -18,17 +18,19 @@ package org.apache.sling.launchpad.tests
 
 import javax.script.Bindings;
 
+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.scripting.api.BindingsValuesProvider;
-/** Example/test BindingsValuesProvider targeting groovy scripts.
-*
-* @scr.component immediate="true" metatype="no"
-* @scr.service
-*
-* @scr.property name="service.description" value="Groovy BindingsValuesProvider"
-* @scr.property name="service.vendor" value="The Apache Software Foundation"
-*
-* @scr.property name="javax.script.name" value="groovy"
-*/
+/** Example/test BindingsValuesProvider targeting groovy scripts */
+@Component(immediate=true, metatype=false)
+@Service
+@Properties({
+    @Property(name="service.description", value="Groovy BindingsValuesProvider"),
+    @Property(name="service.vendor", value="The Apache Software Foundation"),
+    @Property(name="javax.script.name", value="groovy")
+})
 public class GroovyBindingsValuesProvider implements BindingsValuesProvider {
 
     public void addBindings(Bindings bindings) {

Modified: sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/scripting/JSPBindingsValuesProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/scripting/JSPBindingsValuesProvider.java?rev=1074109&r1=1074108&r2=1074109&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/scripting/JSPBindingsValuesProvider.java
(original)
+++ sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/scripting/JSPBindingsValuesProvider.java
Thu Feb 24 11:01:51 2011
@@ -18,17 +18,19 @@ package org.apache.sling.launchpad.tests
 
 import javax.script.Bindings;
 
+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.scripting.api.BindingsValuesProvider;
-/** Example/test BindingsValuesProvider targeting JSP scripts.
-*
-* @scr.component immediate="true" metatype="no"
-* @scr.service
-*
-* @scr.property name="service.description" value="JSP BindingsValuesProvider"
-* @scr.property name="service.vendor" value="The Apache Software Foundation"
-*
-* @scr.property name="javax.script.name" value="JSP"
-*/
+
+/** Example/test BindingsValuesProvider targeting JSP scripts */
+@Component(immediate=true, metatype=false)
+@Service
+@Properties({
+    @Property(name="service.description", value="JSP BindingsValuesProvider"),
+    @Property(name="service.vendor", value="The Apache Software Foundation")
+})
 public class JSPBindingsValuesProvider implements BindingsValuesProvider {
 
     public void addBindings(Bindings bindings) {

Modified: sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/scripting/StandaloneScriptExecutionServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/scripting/StandaloneScriptExecutionServlet.java?rev=1074109&r1=1074108&r2=1074109&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/scripting/StandaloneScriptExecutionServlet.java
(original)
+++ sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/scripting/StandaloneScriptExecutionServlet.java
Thu Feb 24 11:01:51 2011
@@ -21,6 +21,10 @@ import java.io.StringWriter;
 
 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.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
 import org.apache.sling.api.scripting.SlingBindings;
@@ -30,26 +34,18 @@ import org.apache.sling.api.servlets.Sli
 /**
  * Test Servlet that executes a named script in standalone mode, i.e.
  * without a request or response. 
- *
- * @scr.component immediate="true" metatype="no"
- * @scr.service interface="javax.servlet.Servlet"
- *
- * @scr.property name="service.description"
- *               value="StandaloneScriptExecutionServlet Test Servlet"
- * @scr.property name="service.vendor" value="The Apache Software Foundation"
- *
- * @scr.property name="sling.servlet.resourceTypes"
- *               value="sling/servlet/default"
- *               
- * @scr.property name="sling.servlet.selectors"
- *               value = "StandaloneScriptExecutionServlet"
- *                
- * @scr.property name="sling.servlet.extensions"
- *               value = "txt"
- *
  */
-@SuppressWarnings("serial")
 
+@Component(immediate=true, metatype=false)
+@Service(value=javax.servlet.Servlet.class)
+@Properties({
+    @Property(name="service.description", value="StandaloneScriptExecutionServlet Test Servlet"),
+    @Property(name="service.vendor", value="The Apache Software Foundation"),
+    @Property(name="sling.servlet.resourceTypes", value="sling/servlet/default"),
+    @Property(name="sling.servlet.selectors", value = "StandaloneScriptExecutionServlet"),
+    @Property(name="sling.servlet.extensions",value = "txt")
+})
+@SuppressWarnings("serial")
 public class StandaloneScriptExecutionServlet extends SlingSafeMethodsServlet {
 
 	@Override

Modified: sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/scripting/StringBindingsValuesProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/scripting/StringBindingsValuesProvider.java?rev=1074109&r1=1074108&r2=1074109&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/scripting/StringBindingsValuesProvider.java
(original)
+++ sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/scripting/StringBindingsValuesProvider.java
Thu Feb 24 11:01:51 2011
@@ -18,15 +18,18 @@ package org.apache.sling.launchpad.tests
 
 import javax.script.Bindings;
 
+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.scripting.api.BindingsValuesProvider;
-/** Example/test BindingsValuesProvider targetting all scripts.
-*
-* @scr.component immediate="true" metatype="no"
-* @scr.service
-*
-* @scr.property name="service.description" value="String BindingsValuesProvider"
-* @scr.property name="service.vendor" value="The Apache Software Foundation"
-*/
+/** Example/test BindingsValuesProvider targeting all scripts */
+@Component(immediate=true, metatype=false)
+@Service
+@Properties({
+    @Property(name="service.description", value="StringBindingsValuesProvider"),
+    @Property(name="service.vendor", value="The Apache Software Foundation")
+})
 public class StringBindingsValuesProvider implements BindingsValuesProvider {
 
     public void addBindings(Bindings bindings) {

Modified: sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/ExtensionServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/ExtensionServlet.java?rev=1074109&r1=1074108&r2=1074109&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/ExtensionServlet.java
(original)
+++ sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/ExtensionServlet.java
Thu Feb 24 11:01:51 2011
@@ -16,23 +16,20 @@
  */
 package org.apache.sling.launchpad.testservices.servlets;
 
-/** Example/test Sling Servlet registered with two extensions
- *
- * @scr.component immediate="true" metatype="no"
- * @scr.service interface="javax.servlet.Servlet"
- *
- * @scr.property name="service.description" value="Default Query Servlet"
- * @scr.property name="service.vendor" value="The Apache Software Foundation"
- *
- * Register this servlet for the default resource type and two selectors:
- * @scr.property name="sling.servlet.resourceTypes"
- *               value="sling/servlet/default"
- *
- * @scr.property name="sling.servlet.extensions"
- *               values.1 = "TEST_EXT_1"
- *               values.2 = "TEST_EXT_2"
- */
+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;
 
+/** Example/test Sling Servlet registered with two extensions */
+@Component(immediate=true, metatype=false)
+@Service(value=javax.servlet.Servlet.class)
+@Properties({
+    @Property(name="service.description", value="Extension Test Servlet"),
+    @Property(name="service.vendor", value="The Apache Software Foundation"),
+    @Property(name="sling.servlet.resourceTypes", value="sling/servlet/default"),
+    @Property(name="sling.servlet.extensions", value={ "TEST_EXT_1", "TEST_EXT_2" })
+})
 @SuppressWarnings("serial")
 public class ExtensionServlet extends TestServlet {
 }
\ No newline at end of file

Modified: sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/HtmlDefaultServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/HtmlDefaultServlet.java?rev=1074109&r1=1074108&r2=1074109&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/HtmlDefaultServlet.java
(original)
+++ sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/HtmlDefaultServlet.java
Thu Feb 24 11:01:51 2011
@@ -16,24 +16,27 @@
  */
 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;
+
 /**
  * Default servlet for the html extension, see SLING-1069.
- * <p>
  * This servlet collides with the Default GET Servlet generating proper HTML not
  * expected by HtmlDefaultServletTest. For this reason this component is
  * disabled by default and must be enabled for testing in the
  * HtmlDefaultServletTest class.
- *
- * @scr.component enabled="false"
- *                name="org.apache.sling.launchpad.testservices.servlets.HtmlDefaultServlet"
- *                metatype="no" immediate="true" label="%sling.name"
- *                description="%sling.description"
- * @scr.service interface="javax.servlet.Servlet"
- * @scr.property name="sling.servlet.extensions" value="html"
- * @scr.property name="sling.servlet.resourceTypes"
- *               value="sling/servlet/default"
- * @scr.property name="sling.servlet.methods" value="GET"
  */
+@Component(enabled=false, immediate=true, metatype=false)
+@Service(value=javax.servlet.Servlet.class)
+@Properties({
+    @Property(name="service.description", value="Extension Test Servlet"),
+    @Property(name="service.vendor", value="The Apache Software Foundation"),
+    @Property(name="sling.servlet.resourceTypes", value="sling/servlet/default"),
+    @Property(name="sling.servlet.extensions", value="html"),
+    @Property(name="sling.servlet.methods", value="GET")
+})
 @SuppressWarnings("serial")
 public class HtmlDefaultServlet extends TestServlet {
 }
\ No newline at end of file

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=1074109&r1=1074108&r2=1074109&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 Feb 24 11:01:51 2011
@@ -22,24 +22,24 @@ 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.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
 import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
 
 /**
  * Test Servlet which outputs the current namespace mappings.
- *
- * @scr.component immediate="true" metatype="no"
- * @scr.service interface="javax.servlet.Servlet"
- *
- * @scr.property name="service.description"
- *               value="NamespaceMapping Test Servlet"
- * @scr.property name="service.vendor" value="The Apache Software Foundation"
- *
- * @scr.property name="sling.servlet.paths"
- *               values.0="/testing/NamespaceTestServlet/output"
- *
  */
+@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")
+})
 @SuppressWarnings("serial")
 public class NamespaceTestServlet extends SlingSafeMethodsServlet {
 

Modified: sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/PathsServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/PathsServlet.java?rev=1074109&r1=1074108&r2=1074109&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/PathsServlet.java
(original)
+++ sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/PathsServlet.java
Thu Feb 24 11:01:51 2011
@@ -16,18 +16,22 @@
  */
 package org.apache.sling.launchpad.testservices.servlets;
 
-/** Servlet that registers itself for specific paths
- * 
- *  @scr.component immediate="true" metatype="no"
- *  @scr.service interface="javax.servlet.Servlet"
- * 
- *  @scr.property name="service.description" value="Paths Test Servlet"
- *  @scr.property name="service.vendor" value="The Apache Software Foundation"
- * 
- *  @scr.property name="sling.servlet.paths" 
- *                  values.0="/testing/PathsServlet/foo" 
- *                  values.1="/testing/PathsServlet/bar/more/foo.html" 
- * 
- */
+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;
+
+/** Servlet that registers itself for specific paths */
+@Component(immediate=true, metatype=false)
+@Service(value=javax.servlet.Servlet.class)
+@Properties({
+    @Property(name="service.description", value="Paths Test Servlet"),
+    @Property(name="service.vendor", value="The Apache Software Foundation"),
+    @Property(name="sling.servlet.paths", value={
+            "/testing/PathsServlet/foo", 
+            "/testing/PathsServlet/bar/more/foo.html" 
+    })
+})
+@SuppressWarnings("serial")
 public class PathsServlet extends TestServlet {
 }

Modified: sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/PrefixServletMinusOne.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/PrefixServletMinusOne.java?rev=1074109&r1=1074108&r2=1074109&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/PrefixServletMinusOne.java
(original)
+++ sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/PrefixServletMinusOne.java
Thu Feb 24 11:01:51 2011
@@ -16,24 +16,23 @@
  */
 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;
+
 /** Example/test Sling Servlet using a prefix to demonstrate how
  *  PrefixServletZero overrides PrefixServletMinusOne
- *
- * @scr.component immediate="true" metatype="no"
- * @scr.service interface="javax.servlet.Servlet"
- *
- * @scr.property name="service.description" value="Default Query Servlet"
- * @scr.property name="service.vendor" value="The Apache Software Foundation"
- *
- * @scr.property name="sling.servlet.prefix"
- *               value="-1"
- * @scr.property name="sling.servlet.resourceTypes"
- *               value="sling/servlet/default"
- * @scr.property name="sling.servlet.extensions"
- *               values.1="TEST_EXT_3"
- *               values.2="TEST_EXT_4"
  */
-
+@Component(immediate=true, metatype=false)
+@Service(value=javax.servlet.Servlet.class)
+@Properties({
+    @Property(name="service.description", value="Default Query Servlet"),
+    @Property(name="service.vendor", value="The Apache Software Foundation"),
+    @Property(name="sling.servlet.prefix", intValue=-1),
+    @Property(name="sling.servlet.resourceTypes", value="sling/servlet/default"),
+    @Property(name="sling.servlet.extensions", value={ "TEST_EXT_3", "TEST_EXT_4" })
+})
 @SuppressWarnings("serial")
 public class PrefixServletMinusOne extends TestServlet {
 }
\ No newline at end of file

Modified: sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/PrefixServletZero.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/PrefixServletZero.java?rev=1074109&r1=1074108&r2=1074109&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/PrefixServletZero.java
(original)
+++ sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/PrefixServletZero.java
Thu Feb 24 11:01:51 2011
@@ -16,24 +16,23 @@
  */
 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;
+
 /** Example/test Sling Servlet using a prefix to demonstrate how
  *  PrefixServletZero overrides PrefixServletMinusOne
- *
- * @scr.component immediate="true" metatype="no"
- * @scr.service interface="javax.servlet.Servlet"
- *
- * @scr.property name="service.description" value="Default Query Servlet"
- * @scr.property name="service.vendor" value="The Apache Software Foundation"
- *
- * @scr.property name="sling.servlet.prefix"
- *               value="0"
- * @scr.property name="sling.servlet.resourceTypes"
- *               value="sling/servlet/default"
- * @scr.property name="sling.servlet.extensions"
- *               values.1="TEST_EXT_3"
- *               values.2="TEST_EXT_5"
  */
-
+@Component(immediate=true, metatype=false)
+@Service(value=javax.servlet.Servlet.class)
+@Properties({
+    @Property(name="service.description", value="Default Query Servlet"),
+    @Property(name="service.vendor", value="The Apache Software Foundation"),
+    @Property(name="sling.servlet.prefix", intValue=0),
+    @Property(name="sling.servlet.resourceTypes", value="sling/servlet/default"),
+    @Property(name="sling.servlet.extensions", value={ "TEST_EXT_3", "TEST_EXT_5" })
+})
 @SuppressWarnings("serial")
 public class PrefixServletZero extends TestServlet {
 }
\ No newline at end of file

Modified: sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/PutMethodServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/PutMethodServlet.java?rev=1074109&r1=1074108&r2=1074109&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/PutMethodServlet.java
(original)
+++ sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/PutMethodServlet.java
Thu Feb 24 11:01:51 2011
@@ -20,25 +20,24 @@ import java.io.IOException;
 
 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.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
 
 /** Example/test Sling Servlet registered for the PUT method
  *  on a specific resource type
- *
- * @scr.component immediate="true" metatype="no"
- * @scr.service interface="javax.servlet.Servlet"
- *
- * @scr.property name="service.description" value="Default Query Servlet"
- * @scr.property name="service.vendor" value="The Apache Software Foundation"
- *
- * @scr.property name="sling.servlet.resourceTypes"
- *               value="LAUNCHPAD_TEST_ResourceType"
- *
- * @scr.property name="sling.servlet.methods"
- *               value = "PUT"
 */
-
+@Component(immediate=true, metatype=false)
+@Service(value=javax.servlet.Servlet.class)
+@Properties({
+    @Property(name="service.description", value="Default Query Servlet"),
+    @Property(name="service.vendor", value="The Apache Software Foundation"),
+    @Property(name="sling.servlet.methods", value="PUT"),
+    @Property(name="sling.servlet.resourceTypes", value="LAUNCHPAD_TEST_ResourceType")
+})
 @SuppressWarnings("serial")
 public class PutMethodServlet extends TestServlet {
 

Modified: sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/RequestUriOptingServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/RequestUriOptingServlet.java?rev=1074109&r1=1074108&r2=1074109&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/RequestUriOptingServlet.java
(original)
+++ sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/RequestUriOptingServlet.java
Thu Feb 24 11:01:51 2011
@@ -16,24 +16,25 @@
  */
 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.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.servlets.OptingServlet;
 
-/** OptingServlet that uses the RequestURI to opt in
- *  
- *  @scr.component immediate="true" metatype="no"
- *  @scr.service interface="javax.servlet.Servlet"
- * 
- *  @scr.property name="service.description" value="Request URI Opting Test Servlet"
- *  @scr.property name="service.vendor" value="The Apache Software Foundation"
- * 
- *  @scr.property name="sling.servlet.resourceTypes"
- *                  values.0="sling/servlet/default"
- *                  values.1="sling/nonexisting"
- *  @scr.property name="sling.servlet.methods" 
- *                  values.0="POST" 
- *                  values.1="GET" 
- */
+/** OptingServlet that uses the RequestURI to opt in */
+@Component(immediate=true, metatype=false)
+@Service(value=javax.servlet.Servlet.class)
+@Properties({
+    @Property(name="service.description", value="Request URI Opting Test Servlet"),
+    @Property(name="service.vendor", value="The Apache Software Foundation"),
+    @Property(name="sling.servlet.resourceTypes", value={
+            "sling/servlet/default",
+            "sling/nonexisting"
+    }),
+    @Property(name="sling.servlet.methods", value={"POST","GET"})
+})
 @SuppressWarnings("serial")
 public class RequestUriOptingServlet extends TestServlet implements OptingServlet {
 

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=1074109&r1=1074108&r2=1074109&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 Feb 24 11:01:51 2011
@@ -16,26 +16,21 @@
  */
 package org.apache.sling.launchpad.testservices.servlets;
 
-/** Example/test Sling Servlet registered with two selectors
- *
- * @scr.component immediate="true" metatype="no"
- * @scr.service interface="javax.servlet.Servlet"
- *
- * @scr.property name="service.description" value="Default Query Servlet"
- * @scr.property name="service.vendor" value="The Apache Software Foundation"
- *
- * Register this servlet for the default resource type and two selectors:
- * @scr.property name="sling.servlet.resourceTypes"
- *               value="sling/servlet/default"
- *
- * @scr.property name="sling.servlet.selectors"
- *               values.1 = "TEST_SEL_1"
- *               values.2 = "TEST_SEL_2"
- *
- * @scr.property name="sling.servlet.extensions"
- *               value = "txt"
-*/
+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;
 
+/** 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="Default Query Servlet"),
+    @Property(name="service.vendor", value="The Apache Software Foundation"),
+    @Property(name="sling.servlet.resourceTypes", value="sling/servlet/default"),
+    @Property(name="sling.servlet.selectors", value={"TEST_SEL_1","TEST_SEL_2"}),
+    @Property(name="sling.servlet.extensions", value="txt")
+})
 @SuppressWarnings("serial")
 public class SelectorServlet extends TestServlet {
 }
\ No newline at end of file



Mime
View raw message