Package org.jboss.cache.config

Examples of org.jboss.cache.config.Option


       if (!valid) {
          synchronized (invalidationMutex) {
             if (invalidateState.compareAndSet(InvalidateState.INVALID, InvalidateState.CLEARING)) {
                Transaction tx = suspend();
                try {
                   Option opt = new Option();
                   opt.setLockAcquisitionTimeout(1);
                   opt.setCacheModeLocal(true);
                   CacheHelper.removeAll(jbcCache, regionFqn, opt);
                   invalidateState.compareAndSet(InvalidateState.CLEARING, InvalidateState.VALID);
                }
                catch (Exception e) {
                   if (log.isTraceEnabled()) {
View Full Code Here


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

    if ( !checkValid() ) {
      return false;
    }

    try {
      Option opt = new Option();
            opt.setLockAcquisitionTimeout(100);
            CacheHelper.setInvocationOption( jbcCache, opt );
      return CacheHelper.getAllowingTimeout( jbcCache, regionFqn, key ) != null;
    }
    catch ( CacheException ce ) {
      throw ce;
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

    public void evict(Object key) throws CacheException {
      
        ensureRegionRootExists();
       
        // TODO Is this a valid operation on a timestamps cache?
        Option opt = getNonLockingDataVersionOption(true);
        CacheHelper.removeNode(getCacheInstance(), getRegionFqn(), key, opt);
    }
View Full Code Here

    public void evictAll() throws CacheException {
        // TODO Is this a valid operation on a timestamps cache?
        Transaction tx = suspend();
        try {       
           ensureRegionRootExists();
           Option opt = getNonLockingDataVersionOption(true);
           CacheHelper.sendEvictAllNotification(jbcCache, regionFqn, getMemberId(), opt);
        }
        finally {
           resume(tx);
        }       
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 {
            // TODO Why not use the timestamp in a DataVersion?
            Option opt = getNonLockingDataVersionOption(false);
            // We ensure ASYNC semantics (JBCACHE-1175)
            opt.setForceAsynchronous(true);
            CacheHelper.put(getCacheInstance(), getRegionFqn(), key, value, opt);
        } catch (Exception e) {
            throw new CacheException(e);
        } 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

    public void evictAll() throws CacheException {
          Transaction tx = suspend();
          try {       
             ensureRegionRootExists();
             Option opt = getNonLockingDataVersionOption(true);
             CacheHelper.sendEvictAllNotification(jbcCache, regionFqn, getMemberId(), opt);
          }
          finally {
             resume(tx);
          }       
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

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.