Change-Id: If9207cd400515c406969a945270c0f1ed24ceb2c
Signed-off-by: Konsta Pozdeev <konsta.pozdeev@hpe.com>
private static final Logger Log = LoggerFactory.getLogger(DataWaitListener.class);
InstanceIdentifier<D> objectIdentifierId;
private ListenerRegistration<DataWaitListener> dataWaitListenerRegistration;
private static final Logger Log = LoggerFactory.getLogger(DataWaitListener.class);
InstanceIdentifier<D> objectIdentifierId;
private ListenerRegistration<DataWaitListener> dataWaitListenerRegistration;
- Boolean dataAvailable = false;
+ private Boolean dataAvailable = false;
+ private final Object lockDataAvailable = new Object();
private int maxRetries;
LogicalDatastoreType logicalDatastoreType;
DataWaitGetter<D> getData;
private int maxRetries;
LogicalDatastoreType logicalDatastoreType;
DataWaitGetter<D> getData;
if (newDataObject.getRootPath() != null && newDataObject.getRootNode() != null) {
Log.info("data {} created", newDataObject.getRootNode().getIdentifier());
}
if (newDataObject.getRootPath() != null && newDataObject.getRootNode() != null) {
Log.info("data {} created", newDataObject.getRootNode().getIdentifier());
}
- synchronized (dataAvailable) {
- dataAvailable.notifyAll();
+ synchronized (lockDataAvailable) {
+ lockDataAvailable.notifyAll();
if (modifiedDataObject.getRootPath() != null && modifiedDataObject.getRootNode() != null) {
Log.info("data {} updated", modifiedDataObject.getRootNode().getIdentifier());
}
if (modifiedDataObject.getRootPath() != null && modifiedDataObject.getRootNode() != null) {
Log.info("data {} updated", modifiedDataObject.getRootNode().getIdentifier());
}
- synchronized (dataAvailable) {
- dataAvailable.notifyAll();
+ synchronized (lockDataAvailable) {
+ lockDataAvailable.notifyAll();
}
public boolean waitForData(int retry) {
}
public boolean waitForData(int retry) {
- synchronized (dataAvailable) {
+ synchronized (lockDataAvailable) {
dataAvailable = dataAvailable();
if (dataAvailable == true) {
return true;
dataAvailable = dataAvailable();
if (dataAvailable == true) {
return true;
- dataAvailable.wait(waitMillisec);
+ lockDataAvailable.wait(waitMillisec);
} catch (InterruptedException e1) {
}
}
} catch (InterruptedException e1) {
}
}