You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ju...@apache.org on 2011/11/12 02:22:36 UTC

svn commit: r1201140 - in /sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal: JcrResourceResolverFactoryImpl.java scripting/JcrObjectsBindingsValuesProvider.java

Author: justin
Date: Sat Nov 12 01:22:36 2011
New Revision: 1201140

URL: http://svn.apache.org/viewvc?rev=1201140&view=rev
Log:
SLING-2209 - replacing javadoc annotations with java annotations

Modified:
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/scripting/JcrObjectsBindingsValuesProvider.java

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java?rev=1201140&r1=1201139&r2=1201140&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java (original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java Sat Nov 12 01:22:36 2011
@@ -35,6 +35,15 @@ import javax.jcr.SimpleCredentials;
 
 import org.apache.commons.collections.BidiMap;
 import org.apache.commons.collections.bidimap.TreeBidiMap;
+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.PropertyUnbounded;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.apache.felix.scr.annotations.ReferencePolicy;
+import org.apache.felix.scr.annotations.References;
+import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.api.resource.LoginException;
 import org.apache.sling.api.resource.ResourceDecorator;
 import org.apache.sling.api.resource.ResourceProvider;
@@ -50,6 +59,7 @@ import org.apache.sling.jcr.resource.int
 import org.apache.sling.jcr.resource.internal.helper.ResourceProviderEntry;
 import org.apache.sling.jcr.resource.internal.helper.RootResourceProviderEntry;
 import org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProviderEntry;
+import org.osgi.framework.Constants;
 import org.osgi.service.component.ComponentContext;
 import org.osgi.service.event.EventAdmin;
 import org.osgi.util.tracker.ServiceTracker;
@@ -67,23 +77,20 @@ import org.slf4j.LoggerFactory;
  * <li>Fires OSGi EventAdmin events on behalf of internal helper objects
  * </ul>
  *
- * @scr.component immediate="true" label="%resource.resolver.name"
- *                description="%resource.resolver.description" specVersion="1.1"
- * @scr.property name="service.description"
- *                value="Sling JcrResourceResolverFactory Implementation"
- * @scr.property name="service.vendor" value="The Apache Software Foundation"
- * @scr.service interface="org.apache.sling.jcr.resource.JcrResourceResolverFactory"
- * @scr.service interface="org.apache.sling.api.resource.ResourceResolverFactory"
- * @scr.reference name="ResourceProvider"
- *                interface="org.apache.sling.api.resource.ResourceProvider"
- *                cardinality="0..n" policy="dynamic"
- * @scr.reference name="ResourceDecorator"
- *                interface="org.apache.sling.api.resource.ResourceDecorator"
- *                cardinality="0..n" policy="dynamic"
- *
  * First attempt of an resource resolver factory implementation.
  * WORK IN PROGRESS - see SLING-1262
  */
+@Component(immediate=true, label="%resource.resolver.name", description="%resource.resolver.description", specVersion="1.1")
+@Service(value={JcrResourceResolverFactory.class, ResourceResolverFactory.class})
+@Properties({
+    @Property(name = Constants.SERVICE_DESCRIPTION, value="Sling JcrResourceResolverFactory Implementation"),
+    @Property(name = Constants.SERVICE_VENDOR, value="The Apache Software Foundation")
+    
+})
+@References({
+    @Reference(name="ResourceProvider", referenceInterface=ResourceProvider.class, cardinality=ReferenceCardinality.OPTIONAL_MULTIPLE, policy=ReferencePolicy.DYNAMIC),
+    @Reference(name="ResourceDecorator", referenceInterface=ResourceDecorator.class, cardinality=ReferenceCardinality.OPTIONAL_MULTIPLE, policy=ReferencePolicy.DYNAMIC)    
+})
 public class JcrResourceResolverFactoryImpl implements
         JcrResourceResolverFactory, ResourceResolverFactory {
 
@@ -98,15 +105,15 @@ public class JcrResourceResolverFactoryI
         }
     }
 
+    private static final boolean DEFAULT_MULTIWORKSPACE = false;
+
     /**
      * Special value which, if passed to listener.workspaces, will have resource
      * events fired for all workspaces.
      */
     public static final String ALL_WORKSPACES = "*";
 
-    /**
-     * @scr.property values.1="/apps" values.2="/libs"
-     */
+    @Property(value={"/apps", "/libs" })
     public static final String PROP_PATH = "resource.resolver.searchpath";
 
     /**
@@ -129,13 +136,12 @@ public class JcrResourceResolverFactoryI
      * The default value of this property if no configuration is provided is
      * <code>true</code>.
      *
-     * @scr.property value="true" type="Boolean"
      */
+    @Property(boolValue=true)
     private static final String PROP_MANGLE_NAMESPACES = "resource.resolver.manglenamespaces";
 
-    /**
-     * @scr.property value="true" type="Boolean"
-     */
+
+    @Property(boolValue=true)
     private static final String PROP_ALLOW_DIRECT = "resource.resolver.allowDirect";
 
     /**
@@ -143,37 +149,23 @@ public class JcrResourceResolverFactoryI
      * maven plugin and the sling management console cannot handle empty
      * multivalue properties at the moment. So we just add a dummy direct
      * mapping.
-     *
-     * @scr.property values.1="/:/"
      */
+    @Property(value="/:/", unbounded=PropertyUnbounded.ARRAY)
     private static final String PROP_VIRTUAL = "resource.resolver.virtual";
 
-    /**
-     * @scr.property values.1="/:/" values.2="/content/:/"
-     *               values.3="/system/docroot/:/"
-     */
+    @Property(value={"/:/", "/content/:/", "/system/docroot/:/"})
     private static final String PROP_MAPPING = "resource.resolver.mapping";
 
-    /**
-     * @scr.property valueRef="MapEntries.DEFAULT_MAP_ROOT"
-     */
+    @Property(value=MapEntries.DEFAULT_MAP_ROOT)
     private static final String PROP_MAP_LOCATION = "resource.resolver.map.location";
 
-    /**
-     * @scr.property valueRef="DEFAULT_MULTIWORKSPACE"
-     */
+    @Property(boolValue=DEFAULT_MULTIWORKSPACE)
     private static final String PROP_MULTIWORKSPACE = "resource.resolver.multiworkspace";
 
-    private static final boolean DEFAULT_MULTIWORKSPACE = false;
-
     /** default log */
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    /**
-     * The JCR Repository we access to resolve resources
-     *
-     * @scr.reference
-     */
+    @Reference
     private SlingRepository repository;
 
     /** Tracker for the resource decorators. */
@@ -211,8 +203,8 @@ public class JcrResourceResolverFactoryI
      */
     private ServiceTracker eventAdminTracker;
 
-    /** The dynamic class loader
-     * @scr.reference cardinality="0..1" policy="dynamic" */
+    /** The dynamic class loader */
+    @Reference(cardinality=ReferenceCardinality.OPTIONAL_UNARY, policy=ReferencePolicy.DYNAMIC)
     private DynamicClassLoaderManager dynamicClassLoaderManager;
 
     public JcrResourceResolverFactoryImpl() {

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/scripting/JcrObjectsBindingsValuesProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/scripting/JcrObjectsBindingsValuesProvider.java?rev=1201140&r1=1201139&r2=1201140&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/scripting/JcrObjectsBindingsValuesProvider.java (original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/scripting/JcrObjectsBindingsValuesProvider.java Sat Nov 12 01:22:36 2011
@@ -20,18 +20,23 @@ import javax.jcr.Node;
 import javax.jcr.Session;
 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.api.resource.Resource;
 import org.apache.sling.scripting.api.BindingsValuesProvider;
+import org.osgi.framework.Constants;
 
 /**
  * BindingsValuesProvider for currentNode and currentSession object.
- *
- * @scr.component metatype="no"
- * @scr.service
- *
- * @scr.property name="service.description" value="Apache Sling CurrentNode BindingsValuesProvider"
- * @scr.property name="service.vendor" value="The Apache Software Foundation"
  */
+@Component
+@Service
+@Properties({
+    @Property(name=Constants.SERVICE_DESCRIPTION, value="Apache Sling CurrentNode BindingsValuesProvider"),
+    @Property(name=Constants.SERVICE_VENDOR, value="The Apache Software Foundation")
+})
 public class JcrObjectsBindingsValuesProvider implements BindingsValuesProvider {