Package org.jboss.cache.config

Examples of org.jboss.cache.config.Option


            // other nodes on the cluster (if any); this is the
            // cache-mode-local option bit...
            // (2) really just trying a best effort to cleanup after
            // ourselves; lock failures, etc are not critical here;
            // this is the fail-silently option bit...
            Option option = new Option();
            option.setCacheModeLocal(true);
            option.setFailSilently(true);
            if (optimistic) {
                option.setDataVersion(NonLockingDataVersion.INSTANCE);
            }
            jbcCache.getInvocationContext().setOptionOverrides(option);
            jbcCache.removeNode(regionFqn);
            deactivateLocalNode();           
        } catch (Exception e) {
View Full Code Here


     *                       
     * @return the Option, or <code>null</code>.
     */
    protected Option getNonLockingDataVersionOption(boolean allowNullReturn) {
        return optimistic ? NonLockingDataVersion.getInvocationOption()
                          : (allowNullReturn) ? null : new Option();
    }
View Full Code Here

    private static final long serialVersionUID = 7996980646166032369L;

    public static final DataVersion INSTANCE = new CircumventChecksDataVersion();

    public static Option getInvocationOption() {
        Option option = new Option();
        option.setDataVersion(INSTANCE);
        return option;
    }
View Full Code Here

    protected Fqn<String> createRegionFqn(String regionName, String regionPrefix) {
        return getTypeFirstRegionFqn(regionName, regionPrefix, TYPE);
    }

    public void evict(Object key) throws CacheException {
        Option opt = getNonLockingDataVersionOption(true);
        CacheHelper.removeNode(getCacheInstance(), getRegionFqn(), key, opt);
    }
View Full Code Here

        Option opt = getNonLockingDataVersionOption(true);
        CacheHelper.removeNode(getCacheInstance(), getRegionFqn(), key, opt);
    }

    public void evictAll() throws CacheException {
        Option opt = getNonLockingDataVersionOption(true);
        CacheHelper.removeAll(getCacheInstance(), getRegionFqn(), opt);
    }
View Full Code Here

           
            // Don't hold the JBC node lock throughout the tx, as that
            // prevents reads and other updates
            Transaction tx = suspend();
            try {
                Option opt = getNonLockingDataVersionOption(false);
                // We ensure ASYNC semantics (JBCACHE-1175)
                opt.setForceAsynchronous(true);
                CacheHelper.put(getCacheInstance(), getRegionFqn(), key, entry.getJBCUpdateValues(), opt);
            }
            finally {
                resume(tx);
           
View Full Code Here

    public void evict(Object key) throws CacheException {
      
        ensureRegionRootExists();
       
        Option opt = getNonLockingDataVersionOption(false);
        if (localOnly)
            opt.setCacheModeLocal(true);
        CacheHelper.removeNode(getCacheInstance(), getRegionFqn(), key, opt);
    }
View Full Code Here

            opt.setCacheModeLocal(true);
        CacheHelper.removeNode(getCacheInstance(), getRegionFqn(), key, opt);
    }

    public void evictAll() throws CacheException {
        Option opt = getNonLockingDataVersionOption(false);
        if (localOnly)
            opt.setCacheModeLocal(true);
        CacheHelper.removeAll(getCacheInstance(), getRegionFqn(), opt);
    }
View Full Code Here

        // Don't hold the JBC node lock throughout the tx, as that
        // prevents updates
        // Add a zero (or low) timeout option so we don't block
        // waiting for tx's that did a put to commit
        Option opt = new Option();
        opt.setLockAcquisitionTimeout(0);
        return suspendAndGet(key, opt, true);
    }
View Full Code Here

        // 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

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.