incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1308836 - /sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/PostOperationProxyProvider.java
Date Tue, 03 Apr 2012 12:11:17 GMT
Author: bdelacretaz
Date: Tue Apr  3 12:11:17 2012
New Revision: 1308836

URL: http://svn.apache.org/viewvc?rev=1308836&view=rev
Log:
SLING-2186 - fix incorrect copying of properties + add some logging

Modified:
    sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/PostOperationProxyProvider.java

Modified: sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/PostOperationProxyProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/PostOperationProxyProvider.java?rev=1308836&r1=1308835&r2=1308836&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/PostOperationProxyProvider.java
(original)
+++ sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/PostOperationProxyProvider.java
Tue Apr  3 12:11:17 2012
@@ -22,6 +22,7 @@ import java.util.Dictionary;
 import java.util.Hashtable;
 import java.util.IdentityHashMap;
 import java.util.Map;
+
 import org.apache.felix.scr.annotations.Activate;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Deactivate;
@@ -39,6 +40,8 @@ import org.osgi.framework.ServiceEvent;
 import org.osgi.framework.ServiceListener;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.ServiceRegistration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * The <code>PostOperationProxyProvider</code> listens for legacy
@@ -48,6 +51,8 @@ import org.osgi.framework.ServiceRegistr
 @Component(specVersion = "1.1", metatype = false)
 public class PostOperationProxyProvider implements ServiceListener {
 
+    private final Logger log = LoggerFactory.getLogger(getClass());
+    
     /**
      * The service listener filter to listen for SlingPostOperation services
      */
@@ -160,6 +165,7 @@ public class PostOperationProxyProvider 
         final ServiceRegistration reg = bundleContext.registerService(
             PostOperation.SERVICE_NAME, proxy, props);
 
+        log.debug("Registering {}", proxy);
         synchronized (this.proxies) {
             this.proxies.put(serviceReference, reg);
         }
@@ -177,6 +183,7 @@ public class PostOperationProxyProvider 
         }
 
         if (proxyRegistration != null) {
+            log.debug("Updating {}", proxyRegistration);
             proxyRegistration.setProperties(copyServiceProperties(serviceReference));
         }
     }
@@ -193,6 +200,7 @@ public class PostOperationProxyProvider 
         }
 
         if (proxyRegistration != null) {
+            log.debug("Unregistering {}", proxyRegistration);
             this.bundleContext.ungetService(serviceReference);
             proxyRegistration.unregister();
         }
@@ -211,7 +219,7 @@ public class PostOperationProxyProvider 
             props.put(key, serviceReference.getProperty(key));
         }
         props.put(PostOperation.PROP_OPERATION_NAME,
-            serviceReference.getProperty(SlingPostOperation.SERVICE_NAME));
+            serviceReference.getProperty(SlingPostOperation.PROP_OPERATION_NAME));
         props.put(Constants.SERVICE_DESCRIPTION, "Proxy for "
             + serviceReference);
         return props;
@@ -229,6 +237,10 @@ public class PostOperationProxyProvider 
         PostOperationProxy(final SlingPostOperation delegatee) {
             this.delegatee = delegatee;
         }
+        
+        public String toString() {
+            return getClass().getSimpleName() + " for " + delegatee.getClass().getName();
+        }
 
         public void run(SlingHttpServletRequest request, PostResponse response,
                 SlingPostProcessor[] processors) {



Mime
View raw message