@Test public void writeLock() throws Exception { binaryDistributionLockManager.writeLock("TEST-JVM"); binaryDistributionLockManager.writeUnlock("TEST-JVM"); }
@Override public void writeLock(String resourceName) { synchronized(lockObject) { if (!binariesWriteLocks.containsKey(resourceName)) { binariesWriteLocks.put(resourceName, new ReentrantReadWriteLock()); } } binariesWriteLocks.get(resourceName).writeLock().lock(); LOGGER.info("Added write lock for resource {}", resourceName); }
BinaryDistributionLockManagerImpl implements BinaryDistributionLockManager { @Override public void writeLock(String resourceName) { synchronized(lockObject) { if (!binariesWriteLocks.containsKey(resourceName)) { binariesWriteLocks.put(resourceName, new ReentrantReadWriteLock()); } } binariesWriteLocks.get(resourceName).writeLock().lock(); LOGGER.info("Added write lock for resource {}", resourceName); } }
BinaryDistributionLockManagerImpl implements BinaryDistributionLockManager { @Override public void writeLock(String resourceName) { synchronized(lockObject) { if (!binariesWriteLocks.containsKey(resourceName)) { binariesWriteLocks.put(resourceName, new ReentrantReadWriteLock()); } } binariesWriteLocks.get(resourceName).writeLock().lock(); LOGGER.info("Added write lock for resource {}", resourceName); }  }
BinaryDistributionLockManagerImpl implements BinaryDistributionLockManager { @Override public void writeLock(String resourceName) { synchronized(lockObject) { if (!binariesWriteLocks.containsKey(resourceName)) { binariesWriteLocks.put(resourceName, new ReentrantReadWriteLock()); } } binariesWriteLocks.get(resourceName).writeLock().lock(); LOGGER.info("Added write lock for resource {}", resourceName); }  @Override void writeLock(String resourceName); @Override void writeUnlock(String resourceName); }
BinaryDistributionLockManagerImpl implements BinaryDistributionLockManager { @Override public void writeLock(String resourceName) { synchronized(lockObject) { if (!binariesWriteLocks.containsKey(resourceName)) { binariesWriteLocks.put(resourceName, new ReentrantReadWriteLock()); } } binariesWriteLocks.get(resourceName).writeLock().lock(); LOGGER.info("Added write lock for resource {}", resourceName); }  @Override void writeLock(String resourceName); @Override void writeUnlock(String resourceName);  }