Deprecate ClassToInstance-taking methods
[mdsal.git] / binding / mdsal-binding-dom-adapter / src / main / java / org / opendaylight / mdsal / binding / dom / adapter / osgi / OSGiNotificationService.java
index a8cb76f049505fdc2c4fddbbb0ba44cba76e8fbf..3a50aee588080663200e086e4e9a3d2873f5be21 100644 (file)
@@ -7,55 +7,41 @@
  */
 package org.opendaylight.mdsal.binding.dom.adapter.osgi;
 
-import com.google.common.annotations.Beta;
 import java.util.Map;
 import java.util.concurrent.Executor;
 import org.opendaylight.mdsal.binding.api.NotificationService;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.Notification;
-import org.opendaylight.yangtools.yang.binding.NotificationListener;
 import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
 import org.osgi.service.component.annotations.Deactivate;
 
-@Beta
 @Component(factory = OSGiNotificationService.FACTORY_NAME)
 public final class OSGiNotificationService extends AbstractAdaptedService<NotificationService>
         implements NotificationService {
     // OSGi DS Component Factory name
     static final String FACTORY_NAME = "org.opendaylight.mdsal.binding.dom.adapter.osgi.OSGiNotificationService";
 
-    public OSGiNotificationService() {
-        super(NotificationService.class);
+    @Activate
+    public OSGiNotificationService(final Map<String, ?> properties) {
+        super(NotificationService.class, properties);
     }
 
-    @Override
-    @Deprecated(since = "10.0.0", forRemoval = true)
-    public <T extends NotificationListener> ListenerRegistration<T> registerNotificationListener(final T listener) {
-        return delegate().registerNotificationListener(listener);
+    @Deactivate
+    void deactivate(final int reason) {
+        stop(reason);
     }
 
     @Override
     public <N extends Notification<N> & DataObject> Registration registerListener(final Class<N> type,
             final NotificationService.Listener<N> listener, final Executor executor) {
-        return delegate().registerListener(type, listener, executor);
+        return delegate.registerListener(type, listener, executor);
     }
 
     @Override
     public Registration registerCompositeListener(final NotificationService.CompositeListener listener,
             final Executor executor) {
-        return delegate().registerCompositeListener(listener, executor);
-    }
-
-    @Activate
-    void activate(final Map<String, ?> properties) {
-        start(properties);
-    }
-
-    @Deactivate
-    void deactivate(final int reason) {
-        stop(reason);
+        return delegate.registerCompositeListener(listener, executor);
     }
 }