@Test public void testReset() throws InterruptedException, IOException { final LockingManagement memoryLockManager = new MemoryLockManager("default"); final Transaction t1 = Transaction.AUTO_COMMIT; final FeatureLock lock = new FeatureLock("auth2", 1 ); memoryLockManager.lockFeatureID("sometime", "f2", t1, lock); memoryLockManager.refresh("auth2", t1); assertTrue(memoryLockManager.exists("auth2")); memoryLockManager.release("auth2", t1); assertFalse(memoryLockManager.exists("auth2")); }
@Override public boolean exists(final String authID) { synchronized (locks) { final Iterator<Entry<String, AuthorizedLock>> it = locks.entrySet().iterator(); while (it.hasNext()) { final Entry<String, AuthorizedLock> entry = it.next(); if (entry.getValue().isAuthorized(authID) || !entry.getValue().isStale()) { return true; } } } return false; }
MemoryLockManager extends AbstractLockingManagement { @Override public boolean exists(final String authID) { synchronized (locks) { final Iterator<Entry<String, AuthorizedLock>> it = locks.entrySet().iterator(); while (it.hasNext()) { final Entry<String, AuthorizedLock> entry = it.next(); if (entry.getValue().isAuthorized(authID) || !entry.getValue().isStale()) { return true; } } } return false; } }
MemoryLockManager extends AbstractLockingManagement { @Override public boolean exists(final String authID) { synchronized (locks) { final Iterator<Entry<String, AuthorizedLock>> it = locks.entrySet().iterator(); while (it.hasNext()) { final Entry<String, AuthorizedLock> entry = it.next(); if (entry.getValue().isAuthorized(authID) || !entry.getValue().isStale()) { return true; } } } return false; } MemoryLockManager(final String instanceName);  MemoryLockManager(final GeoWavePluginConfig pluginConfig); }
MemoryLockManager extends AbstractLockingManagement { @Override public boolean exists(final String authID) { synchronized (locks) { final Iterator<Entry<String, AuthorizedLock>> it = locks.entrySet().iterator(); while (it.hasNext()) { final Entry<String, AuthorizedLock> entry = it.next(); if (entry.getValue().isAuthorized(authID) || !entry.getValue().isStale()) { return true; } } } return false; } MemoryLockManager(final String instanceName);  MemoryLockManager(final GeoWavePluginConfig pluginConfig); @Override void releaseAll(final AuthorizedLock lock); @Override void resetAll(final AuthorizedLock lock); @SuppressFBWarnings( value = {"MWN_MISMATCHED_WAIT"}, justification = "incorrect flag; lock held (in synchronized block)") @Override void lock(final AuthorizedLock lock, final String featureID); @Override boolean exists(final String authID); @Override void unlock(final AuthorizedLock lock, final String featureID); }
MemoryLockManager extends AbstractLockingManagement { @Override public boolean exists(final String authID) { synchronized (locks) { final Iterator<Entry<String, AuthorizedLock>> it = locks.entrySet().iterator(); while (it.hasNext()) { final Entry<String, AuthorizedLock> entry = it.next(); if (entry.getValue().isAuthorized(authID) || !entry.getValue().isStale()) { return true; } } } return false; } MemoryLockManager(final String instanceName);  MemoryLockManager(final GeoWavePluginConfig pluginConfig); @Override void releaseAll(final AuthorizedLock lock); @Override void resetAll(final AuthorizedLock lock); @SuppressFBWarnings( value = {"MWN_MISMATCHED_WAIT"}, justification = "incorrect flag; lock held (in synchronized block)") @Override void lock(final AuthorizedLock lock, final String featureID); @Override boolean exists(final String authID); @Override void unlock(final AuthorizedLock lock, final String featureID);  }