Package org.jboss.cache.config

Examples of org.jboss.cache.config.Option


           // Reads are done with suspended tx, so they should not hold the
           // lock for long.  Not caching the query result is OK, since
           // any subsequent read will just see the old result with its
           // out-of-date timestamp; that result will be discarded and the
           // db query performed again.
           Option opt = getNonLockingDataVersionOption(false);
           opt.setLockAcquisitionTimeout(2);
           if (localOnly)
               opt.setCacheModeLocal(true);
           CacheHelper.putAllowingTimeout(getCacheInstance(), getRegionFqn(), key, value, opt);
        }
    }
View Full Code Here


    @Override
    public void evict(Object key) throws CacheException {
       
        region.ensureRegionRootExists();

        Option opt = NonLockingDataVersion.getInvocationOption();
        CacheHelper.remove(cache, regionFqn, key, opt);
    }
View Full Code Here

    public void evictAll() throws CacheException
    {
       Transaction tx = region.suspend();
       try {       
          region.ensureRegionRootExists();
          Option opt = NonLockingDataVersion.getInvocationOption();
          CacheHelper.sendEvictAllNotification(cache, regionFqn, region.getMemberId(), opt);
       }
       finally {
          region.resume(tx);
       }
View Full Code Here

        if (!region.checkValid())
            return false;
       
        region.ensureRegionRootExists();

        Option opt = getDataVersionOption(version, null);
        CacheHelper.put(cache, regionFqn, key, value, opt);
        return true;
    }
View Full Code Here

        region.ensureRegionRootExists();

        // We ignore minimalPutOverride. JBossCache putForExternalRead is
        // already about as minimal as we can get; it will promptly return
        // if it discovers that the node we want to write to already exists
        Option opt = getDataVersionOption(version, version);
        return CacheHelper.putForExternalRead(cache, regionFqn, key, value, opt);
    }
View Full Code Here

        if (!region.checkValid())
            return false;
       
        region.ensureRegionRootExists();

        Option opt = getDataVersionOption(version, version);
        return CacheHelper.putForExternalRead(cache, regionFqn, key, value, opt);
    }
View Full Code Here

        // may have already restored the region so they need to
        // be informed of the change.
       
        region.ensureRegionRootExists();

        Option opt = NonLockingDataVersion.getInvocationOption();
        CacheHelper.remove(cache, regionFqn, key, opt);
    }
View Full Code Here

        CacheHelper.remove(cache, regionFqn, key, opt);
    }

    @Override
    public void removeAll() throws CacheException {
       Option opt = NonLockingDataVersion.getInvocationOption();
       CacheHelper.removeAll(cache, regionFqn, opt);
    }
View Full Code Here

        // may have already restored the region so they need to
        // be informed of the change.
       
        region.ensureRegionRootExists();

        Option opt = getDataVersionOption(currentVersion, previousVersion);
        CacheHelper.put(cache, regionFqn, key, value, opt);
        return true;
    }
View Full Code Here

    private Option getDataVersionOption(Object currentVersion, Object previousVersion) {
       
        DataVersion dv = (dataDescription != null && dataDescription.isVersioned()) ? new DataVersionAdapter(
                currentVersion, previousVersion, dataDescription.getVersionComparator(), dataDescription.toString())
                : NonLockingDataVersion.INSTANCE;
        Option opt = new Option();
        opt.setDataVersion(dv);
        return opt;
    }
View Full Code Here

TOP

Related Classes of org.jboss.cache.config.Option

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.