Merge DOMExtensibleService into DOMService
[mdsal.git] / dom / mdsal-dom-broker / src / main / java / org / opendaylight / mdsal / dom / broker / RouterDOMNotificationService.java
diff --git a/dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/RouterDOMNotificationService.java b/dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/RouterDOMNotificationService.java
new file mode 100644 (file)
index 0000000..9869867
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.mdsal.dom.broker;
+
+import javax.inject.Inject;
+import javax.inject.Singleton;
+import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.mdsal.dom.api.DOMNotificationService;
+import org.opendaylight.mdsal.dom.spi.ForwardingDOMNotificationService;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
+
+@Singleton
+@Component(service = DOMNotificationService.class)
+public final class RouterDOMNotificationService extends ForwardingDOMNotificationService {
+    private final @NonNull DOMNotificationService delegate;
+
+    @Inject
+    @Activate
+    public RouterDOMNotificationService(@Reference final DOMNotificationRouter router) {
+        delegate = router.notificationService();
+    }
+
+    @Override
+    protected DOMNotificationService delegate() {
+        return delegate;
+    }
+}