felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1679550 - /felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/
Date Fri, 15 May 2015 11:50:21 GMT
Author: cziegeler
Date: Fri May 15 11:50:20 2015
New Revision: 1679550

URL: http://svn.apache.org/r1679550
Log:
FELIX-4796 : Log deprecation warning if Felix whiteboard is used

Modified:
    felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/AbstractListenerManager.java
    felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/HttpSessionAttributeListenerManager.java
    felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/HttpSessionListenerManager.java
    felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/ServletContextAttributeListenerManager.java
    felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/ServletRequestAttributeListenerManager.java
    felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/ServletRequestListenerManager.java

Modified: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/AbstractListenerManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/AbstractListenerManager.java?rev=1679550&r1=1679549&r2=1679550&view=diff
==============================================================================
--- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/AbstractListenerManager.java
(original)
+++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/AbstractListenerManager.java
Fri May 15 11:50:20 2015
@@ -21,11 +21,16 @@ package org.apache.felix.http.base.inter
 import java.util.ArrayList;
 import java.util.Iterator;
 
+import org.apache.felix.http.base.internal.logger.SystemLogger;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Filter;
 import org.osgi.framework.ServiceReference;
 import org.osgi.util.tracker.ServiceTracker;
 
+/**
+ * @deprecated
+ */
+@Deprecated
 public class AbstractListenerManager<ListenerType> extends ServiceTracker<ListenerType,
ListenerType>
 {
 
@@ -75,33 +80,37 @@ public class AbstractListenerManager<Lis
     @Override
     public ListenerType addingService(ServiceReference<ListenerType> reference)
     {
+        final ListenerType result = super.addingService(reference);
+        if ( result != null ) {
+            SystemLogger.warning("Deprecation warning: " +
+                "Listener registered through Apache Felix whiteboard service: " + reference
+
+                ". Please change your code to the OSGi Whiteboard Service.", null);
+        }
         synchronized (lock)
         {
             allContextListeners = null;
         }
 
-        return super.addingService(reference);
+        return result;
     }
 
     @Override
     public void modifiedService(ServiceReference<ListenerType> reference, ListenerType
service)
     {
+        super.modifiedService(reference, service);
         synchronized (lock)
         {
             allContextListeners = null;
         }
-
-        super.modifiedService(reference, service);
     }
 
     @Override
     public void removedService(ServiceReference<ListenerType> reference, ListenerType
service)
     {
+        super.removedService(reference, service);
         synchronized (lock)
         {
             allContextListeners = null;
         }
-
-        super.removedService(reference, service);
     }
 }

Modified: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/HttpSessionAttributeListenerManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/HttpSessionAttributeListenerManager.java?rev=1679550&r1=1679549&r2=1679550&view=diff
==============================================================================
--- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/HttpSessionAttributeListenerManager.java
(original)
+++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/HttpSessionAttributeListenerManager.java
Fri May 15 11:50:20 2015
@@ -31,7 +31,9 @@ import org.osgi.service.http.whiteboard.
  * The <code>ProxyListener</code> implements the Servlet API 2.4 listener
  * interfaces forwarding any event calls to registered OSGi services
  * implementing the respective Servlet API 2.4 listener interface.
+ * @deprecated
  */
+@Deprecated
 public class HttpSessionAttributeListenerManager extends AbstractListenerManager<HttpSessionAttributeListener>
     implements HttpSessionAttributeListener
 {

Modified: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/HttpSessionListenerManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/HttpSessionListenerManager.java?rev=1679550&r1=1679549&r2=1679550&view=diff
==============================================================================
--- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/HttpSessionListenerManager.java
(original)
+++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/HttpSessionListenerManager.java
Fri May 15 11:50:20 2015
@@ -31,7 +31,10 @@ import org.osgi.service.http.whiteboard.
  * The <code>ProxyListener</code> implements the Servlet API 2.4 listener
  * interfaces forwarding any event calls to registered OSGi services
  * implementing the respective Servlet API 2.4 listener interface.
+ *
+ * @deprecated
  */
+@Deprecated
 public class HttpSessionListenerManager extends AbstractListenerManager<HttpSessionListener>
implements
     HttpSessionListener
 {

Modified: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/ServletContextAttributeListenerManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/ServletContextAttributeListenerManager.java?rev=1679550&r1=1679549&r2=1679550&view=diff
==============================================================================
--- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/ServletContextAttributeListenerManager.java
(original)
+++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/ServletContextAttributeListenerManager.java
Fri May 15 11:50:20 2015
@@ -31,7 +31,9 @@ import org.osgi.service.http.whiteboard.
  * The <code>ProxyListener</code> implements the Servlet API 2.4 listener
  * interfaces forwarding any event calls to registered OSGi services
  * implementing the respective Servlet API 2.4 listener interface.
+ * @deprecated
  */
+@Deprecated
 public class ServletContextAttributeListenerManager extends AbstractListenerManager<ServletContextAttributeListener>
     implements ServletContextAttributeListener
 {

Modified: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/ServletRequestAttributeListenerManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/ServletRequestAttributeListenerManager.java?rev=1679550&r1=1679549&r2=1679550&view=diff
==============================================================================
--- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/ServletRequestAttributeListenerManager.java
(original)
+++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/ServletRequestAttributeListenerManager.java
Fri May 15 11:50:20 2015
@@ -31,7 +31,9 @@ import org.osgi.service.http.whiteboard.
  * The <code>ProxyListener</code> implements the Servlet API 2.4 listener
  * interfaces forwarding any event calls to registered OSGi services
  * implementing the respective Servlet API 2.4 listener interface.
+ * @deprecated
  */
+@Deprecated
 public class ServletRequestAttributeListenerManager
     extends AbstractListenerManager<ServletRequestAttributeListener>
     implements ServletRequestAttributeListener

Modified: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/ServletRequestListenerManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/ServletRequestListenerManager.java?rev=1679550&r1=1679549&r2=1679550&view=diff
==============================================================================
--- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/ServletRequestListenerManager.java
(original)
+++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/listener/ServletRequestListenerManager.java
Fri May 15 11:50:20 2015
@@ -31,7 +31,9 @@ import org.osgi.service.http.whiteboard.
  * The <code>ProxyListener</code> implements the Servlet API 2.4 listener
  * interfaces forwarding any event calls to registered OSGi services
  * implementing the respective Servlet API 2.4 listener interface.
+ * @deprecated
  */
+@Deprecated
 public class ServletRequestListenerManager
     extends AbstractListenerManager<ServletRequestListener>
     implements ServletRequestListener



Mime
View raw message