Package net.sf.ehcache.concurrent

Examples of net.sf.ehcache.concurrent.Sync.unlock()


        }
        if (writeLocked) {
            try {
                removeInternal(key, true, notifyListeners, false, false);
            } finally {
                syncForKey.unlock(LockType.WRITE);
            }
        } else {
            if (LOG.isDebugEnabled()) {
                LOG.debug(configuration.getName() + " cache: element " + key + " expired, but couldn't be inline evicted");
            }
View Full Code Here


        s.lock(lockType);
    }

    private void releaseLockOnKey(Object key, LockType lockType) {
        Sync s = getLockForKey(key);
        s.unlock(lockType);
    }

    /**
     * Acquires the proper read lock for a given cache key
     *
 
View Full Code Here

        s.lock(LockType.WRITE);
        try {
            boolean notOnDisk = !containsKey(element.getObjectKey());
            return memory.putWithWriter(element, writerManager) && notOnDisk;
        } finally {
            s.unlock(LockType.WRITE);
        }
    }

    /**
     * {@inheritDoc}
 
View Full Code Here

                    return d;
                }
            }
            return m;
        } finally {
            s.unlock(LockType.WRITE);
        }
    }

    /**
     * {@inheritDoc}
 
View Full Code Here

                    return d;
                }
            }
            return m;
        } finally {
            s.unlock(LockType.WRITE);
        }
    }

    /**
     * {@inheritDoc}
 
View Full Code Here

            if (e == null) {
                put(element);
            }
            return e;
        } finally {
            lock.unlock(LockType.WRITE);
        }
    }

    /**
     * {@inheritDoc}
 
View Full Code Here

                return remove(current.getObjectKey());
            } else {
                return null;
            }
        } finally {
            lock.unlock(LockType.WRITE);
        }
    }

    /**
     * {@inheritDoc}
 
View Full Code Here

                return true;
            } else {
                return false;
            }
        } finally {
            lock.unlock(LockType.WRITE);
        }
    }

    /**
     * {@inheritDoc}
 
View Full Code Here

            if (current != null) {
                put(element);
            }
            return current;
        } finally {
            lock.unlock(LockType.WRITE);
        }
    }

    /**
     * {@inheritDoc}
 
View Full Code Here

                Sync lock = getLockForKey(key);
                try {
                    lock.lock(LockType.WRITE);
                    update(key);
                } finally {
                    lock.unlock(LockType.WRITE);
                }
            }
            return element;
        } catch (final Throwable throwable) {
            // Could not fetch - Ditch the entry from the cache and rethrow
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.