incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1499236 - in /sling/whiteboard/bdelacretaz/adapter-methods: extensions-adapter/src/main/java/org/apache/sling/adapter/internal/ extensions-adapter/src/test/java/org/apache/sling/adapter/internal/ sling-api/src/main/java/org/apache/sling/ap...
Date Wed, 03 Jul 2013 07:36:34 GMT
Author: bdelacretaz
Date: Wed Jul  3 07:36:34 2013
New Revision: 1499236

URL: http://svn.apache.org/r1499236
Log:
SLING-2938 - rename AdapterMethodsProvider to AdapterProvider, as suggested by Alex Klimetschek

Added:
    sling/whiteboard/bdelacretaz/adapter-methods/sling-api/src/main/java/org/apache/sling/api/adapter/AdapterProvider.java
      - copied, changed from r1499232, sling/whiteboard/bdelacretaz/adapter-methods/sling-api/src/main/java/org/apache/sling/api/adapter/AdapterMethodsProvider.java
Removed:
    sling/whiteboard/bdelacretaz/adapter-methods/sling-api/src/main/java/org/apache/sling/api/adapter/AdapterMethodsProvider.java
Modified:
    sling/whiteboard/bdelacretaz/adapter-methods/extensions-adapter/src/main/java/org/apache/sling/adapter/internal/AdapterMethodsManagerImpl.java
    sling/whiteboard/bdelacretaz/adapter-methods/extensions-adapter/src/test/java/org/apache/sling/adapter/internal/AdapterMethodManagerIT.java
    sling/whiteboard/bdelacretaz/adapter-methods/extensions-adapter/src/test/java/org/apache/sling/adapter/internal/AdapterMethodsManagerImplTest.java
    sling/whiteboard/bdelacretaz/adapter-methods/sling-api/src/main/java/org/apache/sling/api/annotations/Adapter.java

Modified: sling/whiteboard/bdelacretaz/adapter-methods/extensions-adapter/src/main/java/org/apache/sling/adapter/internal/AdapterMethodsManagerImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/bdelacretaz/adapter-methods/extensions-adapter/src/main/java/org/apache/sling/adapter/internal/AdapterMethodsManagerImpl.java?rev=1499236&r1=1499235&r2=1499236&view=diff
==============================================================================
--- sling/whiteboard/bdelacretaz/adapter-methods/extensions-adapter/src/main/java/org/apache/sling/adapter/internal/AdapterMethodsManagerImpl.java
(original)
+++ sling/whiteboard/bdelacretaz/adapter-methods/extensions-adapter/src/main/java/org/apache/sling/adapter/internal/AdapterMethodsManagerImpl.java
Wed Jul  3 07:36:34 2013
@@ -29,7 +29,7 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Deactivate;
 import org.apache.sling.api.adapter.AdapterFactory;
-import org.apache.sling.api.adapter.AdapterMethodsProvider;
+import org.apache.sling.api.adapter.AdapterProvider;
 import org.apache.sling.api.annotations.Adapter;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
@@ -40,7 +40,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Manages {@link AdapterMethodsProvider} services by generating
+ * Manages {@link AdapterProvider} services by generating
  * {@link AdapterFactory} proxies for their adapter methods.
  */
 @Component(immediate=true)
@@ -53,14 +53,14 @@ public class AdapterMethodsManagerImpl {
     private class Tracker extends ServiceTracker {
         
         Tracker() {
-            super(bundleContext, AdapterMethodsProvider.class.getName(), null);
+            super(bundleContext, AdapterProvider.class.getName(), null);
         }
 
         @Override
         public Object addingService(ServiceReference reference) {
             // Extract adapter methods from service object
             // and create an AdapterProxy for each of them
-            final AdapterMethodsProvider p = (AdapterMethodsProvider)bundleContext.getService(reference);
+            final AdapterProvider p = (AdapterProvider)bundleContext.getService(reference);
             for(Method m : p.getClass().getMethods()) {
                 if(m.getAnnotation(Adapter.class) != null) {
                     proxies.add(new AdapterProxy(reference, p, m));

Modified: sling/whiteboard/bdelacretaz/adapter-methods/extensions-adapter/src/test/java/org/apache/sling/adapter/internal/AdapterMethodManagerIT.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/bdelacretaz/adapter-methods/extensions-adapter/src/test/java/org/apache/sling/adapter/internal/AdapterMethodManagerIT.java?rev=1499236&r1=1499235&r2=1499236&view=diff
==============================================================================
--- sling/whiteboard/bdelacretaz/adapter-methods/extensions-adapter/src/test/java/org/apache/sling/adapter/internal/AdapterMethodManagerIT.java
(original)
+++ sling/whiteboard/bdelacretaz/adapter-methods/extensions-adapter/src/test/java/org/apache/sling/adapter/internal/AdapterMethodManagerIT.java
Wed Jul  3 07:36:34 2013
@@ -36,7 +36,7 @@ import java.util.List;
 
 import javax.inject.Inject;
 
-import org.apache.sling.api.adapter.AdapterMethodsProvider;
+import org.apache.sling.api.adapter.AdapterProvider;
 import org.apache.sling.api.adapter.SlingAdaptable;
 import org.apache.sling.api.annotations.Adapter;
 import org.junit.After;
@@ -75,8 +75,8 @@ public class AdapterMethodManagerIT {
         }
     }
     
-    /** Example/test AdapterMethodsProvider that converts TestAdaptable to Long */
-    public static class SingleMethodProvider implements AdapterMethodsProvider {
+    /** Example/test AdapterProvider that converts TestAdaptable to Long */
+    public static class SingleMethodProvider implements AdapterProvider {
         
         @Adapter
         public Long adapt(TestAdaptable src) {
@@ -84,8 +84,8 @@ public class AdapterMethodManagerIT {
         }
     }
     
-    /** Example/test AdapterMethodsProvider that converts TestAdaptable to Integer and URL
*/
-    public static class MultipleMethodsProvider implements AdapterMethodsProvider {
+    /** Example/test AdapterProvider that converts TestAdaptable to Integer and URL */
+    public static class MultipleMethodsProvider implements AdapterProvider {
         
         @Adapter
         public Integer adaptToInt(TestAdaptable src) {
@@ -103,7 +103,7 @@ public class AdapterMethodManagerIT {
         }
     }
     
-    public static class ProviderWithInvalidMethods implements AdapterMethodsProvider {
+    public static class ProviderWithInvalidMethods implements AdapterProvider {
         
         @Adapter
         public Long adapt(TestAdaptable src) {
@@ -154,8 +154,8 @@ public class AdapterMethodManagerIT {
                 )); 
     }
     
-    private void registerProvider(AdapterMethodsProvider p) {
-        registeredServices.add(bundleContext.registerService(AdapterMethodsProvider.class.getName(),
p, null));
+    private void registerProvider(AdapterProvider p) {
+        registeredServices.add(bundleContext.registerService(AdapterProvider.class.getName(),
p, null));
     }
     
     @Before

Modified: sling/whiteboard/bdelacretaz/adapter-methods/extensions-adapter/src/test/java/org/apache/sling/adapter/internal/AdapterMethodsManagerImplTest.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/bdelacretaz/adapter-methods/extensions-adapter/src/test/java/org/apache/sling/adapter/internal/AdapterMethodsManagerImplTest.java?rev=1499236&r1=1499235&r2=1499236&view=diff
==============================================================================
--- sling/whiteboard/bdelacretaz/adapter-methods/extensions-adapter/src/test/java/org/apache/sling/adapter/internal/AdapterMethodsManagerImplTest.java
(original)
+++ sling/whiteboard/bdelacretaz/adapter-methods/extensions-adapter/src/test/java/org/apache/sling/adapter/internal/AdapterMethodsManagerImplTest.java
Wed Jul  3 07:36:34 2013
@@ -28,7 +28,7 @@ import org.junit.Test;
 
 public class AdapterMethodsManagerImplTest {
     
-    private static class GoodAdapterMethodsProvider {
+    private static class GoodAdapterProvider {
         @Adapter
         public String toString(String s) {
             return null;
@@ -40,7 +40,7 @@ public class AdapterMethodsManagerImplTe
         }
     }
     
-    private static class BadAdapterMethodsProvider {
+    private static class BadAdapterProvider {
         @Adapter
         public String twoArgumentsBAD(String s, int i) {
             return null;
@@ -60,7 +60,7 @@ public class AdapterMethodsManagerImplTe
     @Test
     public void testGoodAdapterMethods () {
         int count = 0;
-        for(Method m : GoodAdapterMethodsProvider.class.getMethods()) {
+        for(Method m : GoodAdapterProvider.class.getMethods()) {
             if(m.getAnnotation(Adapter.class) == null) {
                 continue;
             }
@@ -73,7 +73,7 @@ public class AdapterMethodsManagerImplTe
     @Test
     public void testBadAdapterMethods () {
         int count = 0;
-        for(Method m : BadAdapterMethodsProvider.class.getMethods()) {
+        for(Method m : BadAdapterProvider.class.getMethods()) {
             if(m.getAnnotation(Adapter.class) == null) {
                 continue;
             }

Copied: sling/whiteboard/bdelacretaz/adapter-methods/sling-api/src/main/java/org/apache/sling/api/adapter/AdapterProvider.java
(from r1499232, sling/whiteboard/bdelacretaz/adapter-methods/sling-api/src/main/java/org/apache/sling/api/adapter/AdapterMethodsProvider.java)
URL: http://svn.apache.org/viewvc/sling/whiteboard/bdelacretaz/adapter-methods/sling-api/src/main/java/org/apache/sling/api/adapter/AdapterProvider.java?p2=sling/whiteboard/bdelacretaz/adapter-methods/sling-api/src/main/java/org/apache/sling/api/adapter/AdapterProvider.java&p1=sling/whiteboard/bdelacretaz/adapter-methods/sling-api/src/main/java/org/apache/sling/api/adapter/AdapterMethodsProvider.java&r1=1499232&r2=1499236&rev=1499236&view=diff
==============================================================================
--- sling/whiteboard/bdelacretaz/adapter-methods/sling-api/src/main/java/org/apache/sling/api/adapter/AdapterMethodsProvider.java
(original)
+++ sling/whiteboard/bdelacretaz/adapter-methods/sling-api/src/main/java/org/apache/sling/api/adapter/AdapterProvider.java
Wed Jul  3 07:36:34 2013
@@ -21,9 +21,9 @@ package org.apache.sling.api.adapter;
 /**
  * Service that provides Adapter methods.
  * 
- * Public methods annotated with {@link AdapterMethod} that such
+ * Public methods annotated with {@link Adapter} that such
  * a service provides, that take a single parameter of type A and 
  * have return type B are considered adapters from type A to B. 
  */
-public interface AdapterMethodsProvider {
+public interface AdapterProvider {
 }

Modified: sling/whiteboard/bdelacretaz/adapter-methods/sling-api/src/main/java/org/apache/sling/api/annotations/Adapter.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/bdelacretaz/adapter-methods/sling-api/src/main/java/org/apache/sling/api/annotations/Adapter.java?rev=1499236&r1=1499235&r2=1499236&view=diff
==============================================================================
--- sling/whiteboard/bdelacretaz/adapter-methods/sling-api/src/main/java/org/apache/sling/api/annotations/Adapter.java
(original)
+++ sling/whiteboard/bdelacretaz/adapter-methods/sling-api/src/main/java/org/apache/sling/api/annotations/Adapter.java
Wed Jul  3 07:36:34 2013
@@ -25,12 +25,12 @@ import java.lang.annotation.Target;
 
 /**
  * Annotation for Adapter methods, used to identify methods in 
- * {@link AdapterMethodsProvider} services that are used to
+ * {@link AdapterProvider} services that are used to
  * adapt between types.
  * 
  * To be usable as an adapter method, a method that has this
  * annotation must have a non-void return type, take a single
- * argument and declare no exception
+ * argument and declare no Exception.
  */
 @Target( { ElementType.METHOD })
 @Retention(RetentionPolicy.RUNTIME)



Mime
View raw message