Package org.hibernate.cache

Examples of org.hibernate.cache.CacheException


   public void putForExternalRead(Object key, Object value) throws CacheException {
      try {
         cache.putForExternalRead(key, value);
      } catch (Exception e) {
         throw new CacheException(e);
      }
   }
View Full Code Here


   public Object remove(Object key) throws CacheException {
      try {
         return cache.remove(key);
      } catch (Exception e) {
         throw new CacheException(e);
      }
   }
View Full Code Here

   public void evict(Object key) throws CacheException {
      try {
         cache.evict(key);
      } catch (Exception e) {
         throw new CacheException(e);
      }
   }
View Full Code Here

   public void clear() throws CacheException {
      try {
         cache.clear();
      } catch (Exception e) {
         throw new CacheException(e);
      }
   }
View Full Code Here

    public void remove(final Object key) throws CacheException {
        try {
            cache.remove(key);
        } catch (HazelcastException e) {
            throw new CacheException("Operation timeout during remove operation from cache!", e);
        }
    }
View Full Code Here

      cacheAdapter.remove(key);
   }

   public void evictAll() throws CacheException {
      if (!putValidator.invalidateRegion()) {
         throw new CacheException("Failed to invalidate pending putFromLoad calls for region " + region.getName());
      }
      Transaction tx = region.suspend();
      try {
         CacheHelper.sendEvictAllNotification(cacheAdapter, region.getAddress());
      } finally {
View Full Code Here

  
   @Override
   protected CacheManager createCacheManager(Properties properties) throws CacheException {
      String name = PropertiesHelper.getString(CACHE_MANAGER_RESOURCE_PROP, properties, null);
      if (name == null)
         throw new CacheException("Configuration property " + CACHE_MANAGER_RESOURCE_PROP + " not set");
      return locateCacheManager(name, NamingHelper.getJndiProperties(properties));
   }
View Full Code Here

          ctx = new InitialContext(jndiProperties);
          return (CacheManager) ctx.lookup(jndiNamespace);
      } catch (NamingException ne) {
          String msg = "Unable to retrieve CacheManager from JNDI [" + jndiNamespace + "]";
          log.info(msg, ne);
          throw new CacheException( msg );
      } finally {
          if (ctx != null) {
              try {
                  ctx.close();
              } catch( NamingException ne ) {
View Full Code Here

    log.info( "Cache provider: " + providerClassName );
    try {
      cacheProvider = ( CacheProvider ) ReflectHelper.classForName( providerClassName ).newInstance();
    }
    catch ( Exception cnfe ) {
      throw new CacheException( "could not instantiate CacheProvider [" + providerClassName + "]", cnfe );
    }
  }
View Full Code Here

        super(instance, regionName, props, metadata, cache);
    }

    public CollectionRegionAccessStrategy buildAccessStrategy(final AccessType accessType) throws CacheException {
        if (null == accessType) {
            throw new CacheException(
                    "Got null AccessType while attempting to build CollectionRegionAccessStrategy. This can't happen!");
        }
        if (AccessType.READ_ONLY.equals(accessType)) {
            return new CollectionRegionAccessStrategyAdapter(
                    new ReadOnlyAccessDelegate<HazelcastCollectionRegion>(this, props));
        }
        if (AccessType.NONSTRICT_READ_WRITE.equals(accessType)) {
            return new CollectionRegionAccessStrategyAdapter(
                    new NonStrictReadWriteAccessDelegate<HazelcastCollectionRegion>(this, props));
        }
        if (AccessType.READ_WRITE.equals(accessType)) {
            return new CollectionRegionAccessStrategyAdapter(
                    new ReadWriteAccessDelegate<HazelcastCollectionRegion>(this, props));
        }
        if (AccessType.TRANSACTIONAL.equals(accessType)) {
            throw new CacheException("Transactional access is not currently supported by Hazelcast.");
        }
        throw new CacheException("Got unknown AccessType " + accessType
                                 + " while attempting to build CollectionRegionAccessStrategy.");
    }
View Full Code Here

TOP

Related Classes of org.hibernate.cache.CacheException

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.