Package org.hibernate.cache.spi

Examples of org.hibernate.cache.spi.CacheConcurrencyStrategy


      ( (OptimisticCache) underlyingCache ).setSource( new OptimisticCacheSourceAdapter( metadata ) );
    }
  }

  public EntityRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    CacheConcurrencyStrategy ccs;
    if ( AccessType.READ_ONLY.equals( accessType ) ) {
            if (metadata.isMutable()) LOG.readOnlyCacheConfiguredForMutableCollection(getName());
      ccs = new ReadOnlyCache();
    }
    else if ( AccessType.READ_WRITE.equals( accessType ) ) {
      ccs = new ReadWriteCache();
    }
    else if ( AccessType.NONSTRICT_READ_WRITE.equals( accessType ) ) {
      ccs = new NonstrictReadWriteCache();
    }
    else if ( AccessType.TRANSACTIONAL.equals( accessType ) ) {
      ccs = new TransactionalCache();
    }
    else {
      throw new IllegalArgumentException( "unrecognized access strategy type [" + accessType + "]" );
    }
    ccs.setCache( underlyingCache );
    return new EntityAccessStrategyAdapter( this, ccs, settings );
  }
View Full Code Here


      ( ( OptimisticCache ) underlyingCache ).setSource( new OptimisticCacheSourceAdapter( metadata ) );
    }
  }

  public CollectionRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    CacheConcurrencyStrategy ccs;
    if ( AccessType.READ_ONLY.equals( accessType ) ) {
            if (metadata.isMutable()) LOG.readOnlyCacheConfiguredForMutableCollection(getName());
      ccs = new ReadOnlyCache();
    }
    else if ( AccessType.READ_WRITE.equals( accessType ) ) {
      ccs = new ReadWriteCache();
    }
    else if ( AccessType.NONSTRICT_READ_WRITE.equals( accessType ) ) {
      ccs = new NonstrictReadWriteCache();
    }
    else if ( AccessType.TRANSACTIONAL.equals( accessType ) ) {
      ccs = new TransactionalCache();
    }
    else {
      throw new IllegalArgumentException( "unrecognized access strategy type [" + accessType + "]" );
    }
    ccs.setCache( underlyingCache );
    return new CollectionAccessStrategyAdapter( this, ccs, settings );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.cache.spi.CacheConcurrencyStrategy

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.