Package org.jboss.cache.config

Examples of org.jboss.cache.config.Option


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

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


    @Override
    public boolean insert(Object key, Object value, Object version) throws CacheException {
       
        region.ensureRegionRootExists();

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

    }
   
    public static Node addNode(Cache cache, Fqn fqn, boolean localOnly, boolean resident, DataVersion version)
            throws CacheException {
        try {
            Option option = null;
            if (localOnly || version != null) {
                option = new Option();
                option.setCacheModeLocal(localOnly);
                option.setDataVersion(version);
            }
           
            Node root = cache.getRoot();
            setInvocationOption(cache, option);
            // FIXME hack to work around fact that calling
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

    @Override
    public boolean putFromLoad(Object key, Object value, long txTimestamp, Object version) throws CacheException {
       
        region.ensureRegionRootExists();

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

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

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

     *            the cache to set the Option on. Cannot be <code>null</code>.
     * @param version
     *            the DataVersion to set. Cannot be <code>null</code>.
     */
    public static void setDataVersionOption(Cache cache, DataVersion version) {
        Option option = new Option();
        option.setDataVersion(version);
        setInvocationOption(cache, option);
    }
View Full Code Here

    public boolean update(Object key, Object value, Object currentVersion, Object previousVersion)
            throws CacheException {
       
        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

        return opt;
    }

    private void evictOrRemoveAll() {
      
        Option opt = NonLockingDataVersion.getInvocationOption();
        CacheHelper.removeAll(cache, regionFqn, 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.