incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r1166488 - in /sling/trunk/bundles/scripting/core: pom.xml src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactory.java src/main/java/org/apache/sling/scripting/core/impl/SlingScriptAdapterFactory.java
Date Thu, 08 Sep 2011 01:00:23 GMT
Author: justin
Date: Thu Sep  8 01:00:23 2011
New Revision: 1166488

URL: http://svn.apache.org/viewvc?rev=1166488&view=rev
Log:
SLING-2209 - updating annotations

Modified:
    sling/trunk/bundles/scripting/core/pom.xml
    sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactory.java
    sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/SlingScriptAdapterFactory.java

Modified: sling/trunk/bundles/scripting/core/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/core/pom.xml?rev=1166488&r1=1166487&r2=1166488&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/core/pom.xml (original)
+++ sling/trunk/bundles/scripting/core/pom.xml Thu Sep  8 01:00:23 2011
@@ -122,6 +122,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>
 
         <dependency>
             <groupId>org.slf4j</groupId>

Modified: sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactory.java?rev=1166488&r1=1166487&r2=1166488&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactory.java
(original)
+++ sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactory.java
Thu Sep  8 01:00:23 2011
@@ -34,6 +34,10 @@ import javax.script.ScriptEngine;
 import javax.script.ScriptEngineFactory;
 import javax.script.ScriptEngineManager;
 
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.apache.felix.scr.annotations.ReferencePolicy;
 import org.apache.sling.api.scripting.SlingScriptConstants;
 import org.apache.sling.scripting.core.impl.helper.SlingScriptEngineManager;
 import org.osgi.framework.Bundle;
@@ -51,11 +55,10 @@ import org.slf4j.LoggerFactory;
 /**
  * Component which exposes a ScriptEngineManager service.
  *
- * @scr.component metatype="no" immediate="true"
- * @scr.reference name="ScriptEngineFactory"
- *                interface="javax.script.ScriptEngineFactory"
- *                cardinality="0..n" policy="dynamic"
  */
+@Component(metatype=false, immediate=true)
+@Reference(name="ScriptEngineFactory", referenceInterface=ScriptEngineFactory.class,
+           policy=ReferencePolicy.DYNAMIC, cardinality=ReferenceCardinality.OPTIONAL_MULTIPLE)
 public class ScriptEngineManagerFactory implements BundleListener {
 
     private final Logger log = LoggerFactory.getLogger(ScriptEngineManagerFactory.class);

Modified: sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/SlingScriptAdapterFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/SlingScriptAdapterFactory.java?rev=1166488&r1=1166487&r2=1166488&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/SlingScriptAdapterFactory.java
(original)
+++ sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/SlingScriptAdapterFactory.java
Thu Sep  8 01:00:23 2011
@@ -28,6 +28,11 @@ import javax.script.ScriptEngine;
 import javax.script.ScriptEngineFactory;
 import javax.script.ScriptEngineManager;
 
+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.adapter.AdapterFactory;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.commons.mime.MimeTypeProvider;
@@ -47,18 +52,16 @@ import org.slf4j.LoggerFactory;
 /**
  * AdapterFactory that adapts Resources to the DefaultSlingScript servlet, which
  * executes the Resources as scripts.
- *
- * @scr.component metatype="no" immediate="true"
- * @scr.property name="service.vendor" value="The Apache Software Foundation"
- * @scr.property name="service.description" value="Default SlingScriptResolver"
- * @scr.property name="adaptables"
- *               value="org.apache.sling.api.resource.Resource";
- * @scr.property name="adapters"
- *               values.0="org.apache.sling.api.scripting.SlingScript"
- *               values.1="javax.servlet.Servlet"
- * @scr.service interface="org.apache.sling.api.adapter.AdapterFactory"
- * @scr.service interface="org.apache.sling.commons.mime.MimeTypeProvider"
  */
+@Component(metatype=false, immediate=true)
+@Service({AdapterFactory.class, MimeTypeProvider.class})
+@Properties({
+    @Property(name="service.vendor", value="The Apache Software Foundation"),
+    @Property(name="service.description", value="Default SlingScriptResolver"),
+    @Property(name="adaptables", value="org.apache.sling.api.resource.Resource"),
+    @Property(name="adapters", value={"org.apache.sling.api.scripting.SlingScript",
+                                      "javax.servlet.Servlet"})
+})
 public class SlingScriptAdapterFactory implements AdapterFactory, MimeTypeProvider {
 
     private final Logger log = LoggerFactory.getLogger(SlingScriptAdapterFactory.class);
@@ -95,9 +98,8 @@ public class SlingScriptAdapterFactory i
 
     /**
      * The script engine manager.
-     *
-     * @scr.reference
      */
+    @Reference
     private ScriptEngineManager scriptEngineManager;
 
     // ---------- AdapterFactory -----------------------------------------------



Mime
View raw message