Search in sources :

Example 1 with DistributedDataStoreInterface

use of org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface in project controller by opendaylight.

the class DistributedOperationalDataStoreProviderModule method createInstance.

@Override
public java.lang.AutoCloseable createInstance() {
    // The DistributedOperDataStore is provided via blueprint so wait for and return it here for
    // backwards compatibility
    WaitingServiceTracker<DistributedDataStoreInterface> tracker = WaitingServiceTracker.create(DistributedDataStoreInterface.class, bundleContext, "(type=distributed-operational)");
    DistributedDataStoreInterface delegate = tracker.waitForService(WaitingServiceTracker.FIVE_MINUTES);
    return new LegacyDOMStoreAdapter(delegate) {

        @Override
        public void close() {
            tracker.close();
        }
    };
}
Also used : DistributedDataStoreInterface(org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface) LegacyDOMStoreAdapter(org.opendaylight.controller.cluster.datastore.compat.LegacyDOMStoreAdapter)

Example 2 with DistributedDataStoreInterface

use of org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface in project controller by opendaylight.

the class DistributedConfigDataStoreProviderModule method createInstance.

@Override
public AutoCloseable createInstance() {
    // The DistributedConfigDataStore is provided via blueprint so wait for and return it here for
    // backwards compatibility.
    WaitingServiceTracker<DistributedDataStoreInterface> tracker = WaitingServiceTracker.create(DistributedDataStoreInterface.class, bundleContext, "(type=distributed-config)");
    DistributedDataStoreInterface delegate = tracker.waitForService(WaitingServiceTracker.FIVE_MINUTES);
    return new LegacyDOMStoreAdapter(delegate) {

        @Override
        public void close() {
            tracker.close();
        }
    };
}
Also used : DistributedDataStoreInterface(org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface) LegacyDOMStoreAdapter(org.opendaylight.controller.cluster.datastore.compat.LegacyDOMStoreAdapter)

Aggregations

DistributedDataStoreInterface (org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface)2 LegacyDOMStoreAdapter (org.opendaylight.controller.cluster.datastore.compat.LegacyDOMStoreAdapter)2