Package org.jboss.cache.config

Examples of org.jboss.cache.config.Option


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

        Option opt = getDataVersionOption(version, null);
        if (this.invalidation) {
          opt.setCacheModeLocal(true);
        }
        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 (!putValidator.isPutValid(key))
           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

    }

    @Override
    public void removeAll() throws CacheException {
       putValidator.regionRemoved();
       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) {
       
       org.jboss.cache.optimistic.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

   }

   @SuppressWarnings("deprecation")
   private Object handleAll(InvocationContext ctx, VisitableCommand command, GlobalTransaction gtx, boolean scrubContextOnCompletion) throws Throwable
   {
      Option optionOverride = ctx.getOptionOverrides();
      boolean suppressExceptions = false;
      Transaction suspendedTransaction = null;
      boolean resumeSuspended = false;

      if (trace) log.trace("Invoked with command " + command + " and InvocationContext [" + ctx + "]");

      try
      {
         if (txManager != null)
         {
            Transaction tx = getTransaction();
            GlobalTransaction realGtx = getGlobalTransaction(tx, gtx);
            if (tx == null && realGtx != null && realGtx.isRemote()) tx = txTable.getLocalTransaction(gtx);
            setTransactionalContext(tx, realGtx, null, ctx);
         }
         else
         {
            setTransactionalContext(null, null, null, ctx);
         }

         if (optionOverride != null && optionOverride.isFailSilently())
         {
            log.debug("FAIL_SILENTLY Option is present - suspending any ongoing transaction.");
            suppressExceptions = true;
            if (ctx.getTransaction() != null)
            {
View Full Code Here

    writeUpdate( key, value, currentVersion, null );
  }

  public void writeUpdate(Object key, Object value, Object currentVersion, Object previousVersion) {
    try {
      Option option = new Option();
      DataVersion dv = ( source != null && source.isVersioned() )
                       ? new DataVersionAdapter( currentVersion, previousVersion, source.getVersionComparator(), source.toString() )
                       : NonLockingDataVersion.INSTANCE;
      option.setDataVersion( dv );
      cache.put( new Fqn( regionFqn, key ), ITEM, value, option );
    }
    catch ( Exception e ) {
      throw new CacheException( e );
    }
View Full Code Here

    }
  }

  public void writeLoad(Object key, Object value, Object currentVersion) {
    try {
      Option option = new Option();
      option.setFailSilently( true );
      option.setDataVersion( NonLockingDataVersion.INSTANCE );
      cache.remove( new Fqn( regionFqn, key ), "ITEM", option );

      option = new Option();
      option.setFailSilently( true );
      DataVersion dv = ( source != null && source.isVersioned() )
                       ? new DataVersionAdapter( currentVersion, currentVersion, source.getVersionComparator(), source.toString() )
                       : NonLockingDataVersion.INSTANCE;
      option.setDataVersion( dv );
      cache.put( new Fqn( regionFqn, key ), ITEM, value, option );
    }
    catch (Exception e) {
      throw new CacheException(e);
    }
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.