Package org.jboss.cache.config

Examples of org.jboss.cache.config.Option


      assertEquals(expected, eventLog.events);
   }
  
   protected void setSuppressEventNotification()
   {
      Option option = new Option();
      option.setSuppressEventNotification(true);
      cache.getInvocationContext().setOptionOverrides(option);     
   }
View Full Code Here


      c = new Configuration();
      c.setCacheMode("REPL_SYNC");
      c.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      cache2 = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c, false, getClass());

      cacheModeLocal = new Option();
      cacheModeLocal.setCacheModeLocal(true);
   }
View Full Code Here

   public void testCacheStoringImplicitTxOptionOverride() throws Exception
   {
      CacheSPI<Object, Object> cache = createCacheWithLoader();
      CacheLoader loader = cache.getCacheLoaderManager().getCacheLoader();
      Option option = new Option();
      option.setCacheModeLocal(true);
      cache.getInvocationContext().setOptionOverrides(option);
      cache.put(fqn, key, value);
      assertEquals(value, cache.get(fqn, key));
      //now lets see if the state has been persisted in the cache loader
      assertNotNull(loader.get(fqn));
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

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