Package net.sf.ehcache

Examples of net.sf.ehcache.CacheEntry


        throws CacheException
    {
        Element removed = remove( key );
        if ( writerManager != null )
        {
            writerManager.remove( new CacheEntry( key, removed ) );
        }
        return removed;
    }
View Full Code Here


        throws CacheException
    {
        Element removed = remove( key );
        if ( writerManager != null )
        {
            writerManager.remove( new CacheEntry( key, removed ) );
        }
        return removed;
    }
View Full Code Here

     * {@inheritDoc}
     */
    public Element removeWithWriter(Object key, CacheWriterManager writerManager) {
        Element removed = remove(key);
        if (writerManager != null) {
            writerManager.remove(new CacheEntry(key, removed));
        }
        return removed;
    }
View Full Code Here

        }

        // remove single item.
        Element element = map.remove(key);
        if (writerManager != null) {
            writerManager.remove(new CacheEntry(key, element));
        }
        if (element != null) {
            return element;
        } else {
            if (LOG.isDebugEnabled()) {
View Full Code Here

        // this forces enlistment so the XA transaction timeout can be propagated to the XA resource
        getOrCreateTransactionContext();

        Element oldElement = getQuietFromUnderlyingStore(key);
        if (writerManager != null) {
            writerManager.remove(new CacheEntry(key, null));
        } else {
            cache.getWriterManager().remove(new CacheEntry(key, null));
        }
        return removeInternal(new StoreRemoveCommand(key, oldElement));
    }
View Full Code Here

     * Getter to the cache entry to be removed
     *
     * @return the cache entry
     */
    public CacheEntry getEntry() {
        return new CacheEntry(key, getOldElement());
    }
View Full Code Here

            return null;
        }
        assertNotTimedOut();

        Element removed = remove(key);
        final CacheEntry cacheEntry = new CacheEntry(key, getQuiet(key));
        getCurrentTransactionContext().addListener(new TransactionListener() {
            public void beforeCommit() {
                if (writerManager != null) {
                    writerManager.remove(cacheEntry);
                } else {
View Full Code Here

    private synchronized Element removeInternal(Object key, CacheWriterManager writerManager) throws CacheException {
        // remove single item.
        Element element = (Element) map.remove(key);
        if (writerManager != null) {
            writerManager.remove(new CacheEntry(key, element));
        }
        if (element != null) {
            return element;
        } else {
            return null;
View Full Code Here

     */
    public Element removeWithWriter(final Object key, final CacheWriterManager writerManager) throws CacheException {
        registerInJtaContext();
        try {
            Element removed = underlyingStore.remove(key);
            final CacheEntry cacheEntry = new CacheEntry(key, getQuiet(key));
            transactionManager.getTransaction().registerSynchronization(new Synchronization() {
                public void beforeCompletion() {
                    if (writerManager != null) {
                        writerManager.remove(cacheEntry);
                    } else {
View Full Code Here

    private CacheEntry duplicateCacheEntryElement(CacheEntry entry) {
        if (null == entry.getElement()) {
            return entry;
        } else {
            Element element = entry.getElement();
            return new CacheEntry(entry.getKey(), new Element(element.getObjectKey(), element.getObjectValue(), element.getVersion(),
                    element.getCreationTime(), element.getLastAccessTime(), element.getHitCount(), false,
                    element.getTimeToLive(), element.getTimeToIdle(), element.getLastUpdateTime()));
        }
    }
View Full Code Here

TOP

Related Classes of net.sf.ehcache.CacheEntry

Copyright © 2018 www.massapicom. 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.