X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=hwvtepsouthbound%2Fhwvtepsouthbound-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fovsdb%2Fhwvtepsouthbound%2FHwvtepSouthboundProvider.java;h=1c9af4e5d3231f3bbaba096e4d42c9e4209bffe6;hb=8dc6c29e45b896c0a1a35d272179c15d68b27a77;hp=bf6d2707bc6fd26b9ff46f52ff314ddf393de5e9;hpb=cc8dfaa60ef37d2801de0439b61ed72ffd178360;p=ovsdb.git diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepSouthboundProvider.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepSouthboundProvider.java index bf6d2707b..1c9af4e5d 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepSouthboundProvider.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepSouthboundProvider.java @@ -12,6 +12,11 @@ import com.google.common.util.concurrent.CheckedFuture; import java.util.Collection; import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicBoolean; +import javax.annotation.PostConstruct; +import javax.annotation.PreDestroy; +import javax.inject.Inject; +import javax.inject.Singleton; +import org.apache.aries.blueprint.annotation.service.Reference; import org.opendaylight.controller.md.sal.binding.api.ClusteredDataTreeChangeListener; import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier; @@ -41,6 +46,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@Singleton public class HwvtepSouthboundProvider implements ClusteredDataTreeChangeListener, AutoCloseable { private static final Logger LOG = LoggerFactory.getLogger(HwvtepSouthboundProvider.class); @@ -59,11 +65,12 @@ public class HwvtepSouthboundProvider implements ClusteredDataTreeChangeListener private final AtomicBoolean registered = new AtomicBoolean(false); private ListenerRegistration operTopologyRegistration; - public HwvtepSouthboundProvider(final DataBroker dataBroker, - final EntityOwnershipService entityOwnershipServiceDependency, - final OvsdbConnection ovsdbConnection, - final DOMSchemaService schemaService, - final BindingNormalizedNodeSerializer bindingNormalizedNodeSerializer) { + @Inject + public HwvtepSouthboundProvider(@Reference final DataBroker dataBroker, + @Reference final EntityOwnershipService entityOwnershipServiceDependency, + @Reference final OvsdbConnection ovsdbConnection, + @Reference final DOMSchemaService schemaService, + @Reference final BindingNormalizedNodeSerializer bindingNormalizedNodeSerializer) { this.dataBroker = dataBroker; this.entityOwnershipService = entityOwnershipServiceDependency; registration = null; @@ -76,6 +83,7 @@ public class HwvtepSouthboundProvider implements ClusteredDataTreeChangeListener /** * Used by blueprint when starting the container. */ + @PostConstruct public void init() { LOG.info("HwvtepSouthboundProvider Session Initiated"); txInvoker = new TransactionInvokerImpl(dataBroker); @@ -105,6 +113,7 @@ public class HwvtepSouthboundProvider implements ClusteredDataTreeChangeListener } @Override + @PreDestroy @SuppressWarnings("checkstyle:IllegalCatch") public void close() throws Exception { LOG.info("HwvtepSouthboundProvider Closed");