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;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@Singleton
public class HwvtepSouthboundProvider implements ClusteredDataTreeChangeListener<Topology>, AutoCloseable {
private static final Logger LOG = LoggerFactory.getLogger(HwvtepSouthboundProvider.class);
private final AtomicBoolean registered = new AtomicBoolean(false);
private ListenerRegistration<HwvtepSouthboundProvider> 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;
/**
* Used by blueprint when starting the container.
*/
+ @PostConstruct
public void init() {
LOG.info("HwvtepSouthboundProvider Session Initiated");
txInvoker = new TransactionInvokerImpl(dataBroker);
}
@Override
+ @PreDestroy
@SuppressWarnings("checkstyle:IllegalCatch")
public void close() throws Exception {
LOG.info("HwvtepSouthboundProvider Closed");