Reduce ObjectRegistration use
[mdsal.git] / binding / mdsal-binding-dom-adapter / src / main / java / org / opendaylight / mdsal / binding / dom / adapter / osgi / OSGiNotificationPublishService.java
index f46fa9b96e715d87cf20f44342191df2412e220f..1758a9bdaf4b24a17e53c765ce13b8dcee1f8106 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.mdsal.binding.dom.adapter.osgi;
 
-import com.google.common.annotations.Beta;
 import com.google.common.util.concurrent.ListenableFuture;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
@@ -17,40 +16,35 @@ import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
 import org.osgi.service.component.annotations.Deactivate;
 
-@Beta
 @Component(factory = OSGiNotificationPublishService.FACTORY_NAME)
 public final class OSGiNotificationPublishService extends AbstractAdaptedService<NotificationPublishService>
         implements NotificationPublishService {
     // OSGi DS Component Factory name
     static final String FACTORY_NAME = "org.opendaylight.mdsal.binding.dom.adapter.osgi.OSGiNotificationPublishService";
 
-    public OSGiNotificationPublishService() {
-        super(NotificationPublishService.class);
+    @Activate
+    public OSGiNotificationPublishService(final Map<String, ?> properties) {
+        super(NotificationPublishService.class, properties);
+    }
+
+    @Deactivate
+    void deactivate(final int reason) {
+        stop(reason);
     }
 
     @Override
     public void putNotification(final Notification<?> notification) throws InterruptedException {
-        delegate().putNotification(notification);
+        delegate.putNotification(notification);
     }
 
     @Override
     public ListenableFuture<? extends Object> offerNotification(final Notification<?> notification) {
-        return delegate().offerNotification(notification);
+        return delegate.offerNotification(notification);
     }
 
     @Override
     public ListenableFuture<? extends Object> offerNotification(final Notification<?> notification, final int timeout,
             final TimeUnit unit) throws InterruptedException {
-        return delegate().offerNotification(notification, timeout, unit);
-    }
-
-    @Activate
-    void activate(final Map<String, ?> properties) {
-        start(properties);
-    }
-
-    @Deactivate
-    void deactivate(final int reason) {
-        stop(reason);
+        return delegate.offerNotification(notification, timeout, unit);
     }
 }