*/
package org.onap.music.lockingservice;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.ZooDefs;
private int retryCount = 10;
private List<ACL> acl = ZooDefs.Ids.OPEN_ACL_UNSAFE;
- // public ProtocolSupport(ZooKeeper zookeeper) {
- // this.zookeeper = zookeeper;
- // }
-
/**
* Closes this strategy and releases any ZooKeeper resources; but keeps the ZooKeeper instance
* open
/**
* Allow derived classes to perform some custom closing operations to release resources
*/
- protected void doClose() {}
+ protected void doClose() {
+ throw new UnsupportedOperationException();
+ }
/**
return true;
}
});
- } catch (KeeperException e) {
- LOG.error(EELFLoggerDelegate.errorLogger,"Caught: " + e, e);
- } catch (InterruptedException e) {
+ } catch (InterruptedException|KeeperException e) {
LOG.error(EELFLoggerDelegate.errorLogger,"Caught: " + e, e);
}
}
Thread.sleep(attemptCount * retryDelay);
} catch (InterruptedException e) {
LOG.error(EELFLoggerDelegate.errorLogger,"Failed to sleep: " + e, e);
+ Thread.currentThread().interrupt();
}
}
}