private void waitForQueueSizeToDrop() { if (maxQueueSize > 0) { while (getQueueSize() >= maxQueueSize) { try { queueIsFull.await(); } catch (InterruptedException e) { stop(); Thread.currentThread().interrupt(); } } } }
/** * {@inheritDoc} */ public void write(Element element) { queueWriteLock.lock(); try { waitForQueueSizeToDrop(); if (stopping || stopped) { throw new CacheException("The element '" + element + "' couldn't be added through the write-behind queue for cache '" + cacheName + "' since it's not started."); } addItem(new WriteOperation(element)); if (getQueueSize() + 1 < maxQueueSize) { queueIsFull.signal(); } queueIsEmpty.signal(); } finally { queueWriteLock.unlock(); } }
while (!stopping && getQueueSize() == 0) { queueIsEmpty.await(); if (stopping && getQueueSize() == 0) { stopTheQueueThread();
/** * {@inheritDoc} */ public void delete(CacheEntry entry) { queueWriteLock.lock(); try { waitForQueueSizeToDrop(); if (stopping || stopped) { throw new CacheException("The entry for key '" + entry.getKey() + "' couldn't be deleted through the write-behind " + "queue for cache '" + cacheName + "' since it's not started."); } addItem(new DeleteOperation(entry)); if (getQueueSize() + 1 < maxQueueSize) { queueIsFull.signal(); } queueIsEmpty.signal(); } finally { queueWriteLock.unlock(); } }
try { if (getQueueSize() > 0) { quarantined = quarantineItems(); } else {
private void waitForQueueSizeToDrop() { if (maxQueueSize > 0) { while (getQueueSize() >= maxQueueSize) { try { queueIsFull.await(); } catch (InterruptedException e) { stop(); Thread.currentThread().interrupt(); } } } }
private void waitForQueueSizeToDrop() { if (maxQueueSize > 0) { while (getQueueSize() >= maxQueueSize) { try { queueIsFull.await(); } catch (InterruptedException e) { stop(); Thread.currentThread().interrupt(); } } } }
private void waitForQueueSizeToDrop() { if (maxQueueSize > 0) { while (getQueueSize() >= maxQueueSize) { try { queueIsFull.await(); } catch (InterruptedException e) { stop(); Thread.currentThread().interrupt(); } } } }
while (!stopping && getQueueSize() == 0) { queueIsEmpty.await(); if (stopping && getQueueSize() == 0) { stopTheQueueThread();
/** * {@inheritDoc} */ public void write(Element element) { queueWriteLock.lock(); try { waitForQueueSizeToDrop(); if (stopping || stopped) { throw new CacheException("The element '" + element + "' couldn't be added through the write-behind queue for cache '" + cacheName + "' since it's not started."); } addItem(new WriteOperation(element)); if (getQueueSize() + 1 < maxQueueSize) { queueIsFull.signal(); } queueIsEmpty.signal(); } finally { queueWriteLock.unlock(); } }
while (!stopping && getQueueSize() == 0) { queueIsEmpty.await(); if (stopping && getQueueSize() == 0) { stopTheQueueThread();
while (!stopping && getQueueSize() == 0) { queueIsEmpty.await(); if (stopping && getQueueSize() == 0) { stopTheQueueThread();
/** * {@inheritDoc} */ public void write(Element element) { queueWriteLock.lock(); try { waitForQueueSizeToDrop(); if (stopping || stopped) { throw new CacheException("The element '" + element + "' couldn't be added through the write-behind queue for cache '" + cacheName + "' since it's not started."); } addItem(new WriteOperation(element)); if (getQueueSize() + 1 < maxQueueSize) { queueIsFull.signal(); } queueIsEmpty.signal(); } finally { queueWriteLock.unlock(); } }
/** * {@inheritDoc} */ public void write(Element element) { queueWriteLock.lock(); try { waitForQueueSizeToDrop(); if (stopping || stopped) { throw new CacheException("The element '" + element + "' couldn't be added through the write-behind queue for cache '" + cacheName + "' since it's not started."); } addItem(new WriteOperation(element)); if (getQueueSize() + 1 < maxQueueSize) { queueIsFull.signal(); } queueIsEmpty.signal(); } finally { queueWriteLock.unlock(); } }
/** * {@inheritDoc} */ public void delete(CacheEntry entry) { queueWriteLock.lock(); try { waitForQueueSizeToDrop(); if (stopping || stopped) { throw new CacheException("The entry for key '" + entry.getKey() + "' couldn't be deleted through the write-behind " + "queue for cache '" + cacheName + "' since it's not started."); } addItem(new DeleteOperation(entry)); if (getQueueSize() + 1 < maxQueueSize) { queueIsFull.signal(); } queueIsEmpty.signal(); } finally { queueWriteLock.unlock(); } }
/** * {@inheritDoc} */ public void delete(CacheEntry entry) { queueWriteLock.lock(); try { waitForQueueSizeToDrop(); if (stopping || stopped) { throw new CacheException("The entry for key '" + entry.getKey() + "' couldn't be deleted through the write-behind " + "queue for cache '" + cacheName + "' since it's not started."); } addItem(new DeleteOperation(entry)); if (getQueueSize() + 1 < maxQueueSize) { queueIsFull.signal(); } queueIsEmpty.signal(); } finally { queueWriteLock.unlock(); } }
/** * {@inheritDoc} */ public void delete(CacheEntry entry) { queueWriteLock.lock(); try { waitForQueueSizeToDrop(); if (stopping || stopped) { throw new CacheException("The entry for key '" + entry.getKey() + "' couldn't be deleted through the write-behind " + "queue for cache '" + cacheName + "' since it's not started."); } addItem(new DeleteOperation(entry)); if (getQueueSize() + 1 < maxQueueSize) { queueIsFull.signal(); } queueIsEmpty.signal(); } finally { queueWriteLock.unlock(); } }
try { if (getQueueSize() > 0) { quarantined = quarantineItems(); } else {
try { if (getQueueSize() > 0) { quarantined = quarantineItems(); } else {
try { if (getQueueSize() > 0) { quarantined = quarantineItems(); } else {