Package org.hibernate.cache

Examples of org.hibernate.cache.CacheException


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

    public EntityRegionAccessStrategy buildAccessStrategy(final AccessType accessType) throws CacheException {
        if (null == accessType) {
            throw new CacheException(
                    "Got null AccessType while attempting to determine a proper EntityRegionAccessStrategy. This can't happen!");
        }
        if (AccessType.READ_ONLY.equals(accessType)) {
            return new EntityRegionAccessStrategyAdapter(
                    new ReadOnlyAccessDelegate<HazelcastEntityRegion>(this, props));
        }
        if (AccessType.NONSTRICT_READ_WRITE.equals(accessType)) {
            return new EntityRegionAccessStrategyAdapter(
                    new NonStrictReadWriteAccessDelegate<HazelcastEntityRegion>(this, props));
        }
        if (AccessType.READ_WRITE.equals(accessType)) {
            return new EntityRegionAccessStrategyAdapter(
                    new ReadWriteAccessDelegate<HazelcastEntityRegion>(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 EntityRegionAccessStrategy.");
    }
View Full Code Here


        }
        try {
            client.getLifecycleService().shutdown();
            client = null;
        } catch (Exception e) {
            throw new CacheException(e);
        }
    }
View Full Code Here

                config = ConfigLoader.load(configResourcePath);
            } catch (IOException e) {
                logger.warning("IOException: " + e.getMessage());
            }
            if (config == null) {
                throw new CacheException("Could not find configuration file: " + configResourcePath);
            }
        }
        if (instanceName != null) {
            instance = Hazelcast.getHazelcastInstanceByName(instanceName);
            if (instance == null) {
View Full Code Here

        }
        try {
            instance.getLifecycleService().shutdown();
            instance = null;
        } catch (Exception e) {
            throw new CacheException(e);
        }
    }
View Full Code Here

            } else {
                loaderClass = cl.loadClass(HZ_INSTANCE_LOADER_CLASSNAME);
            }
            loader = (IHazelcastInstanceLoader) loaderClass.newInstance();
        } catch (Exception e) {
            throw new CacheException(e);
        }
        loader.configure(props);
        return loader;
    }
View Full Code Here

                Thread.currentThread().interrupt();
            }
        }
        service.removeListener(listener);
        if (service.getState() != ServiceController.State.UP) {
            throw new CacheException(service.getStartException());
        }
        EmbeddedCacheManagerConfiguration config = service.getValue();
        GlobalConfiguration global = new GlobalConfigurationBuilder().read(config.getGlobalConfiguration()).classLoader(this.getClass().getClassLoader()).build();
        EmbeddedCacheManager manager = new DefaultEmbeddedCacheManager(global, config.getDefaultCache());
        manager.start();
View Full Code Here

      try {
         // We ensure ASYNC semantics (JBCACHE-1175) and make sure previous
         // value is not loaded from cache store cos it's not needed.
         cacheAdapter.withFlags(FlagAdapter.FORCE_ASYNCHRONOUS).put(key, value);
      } catch (Exception e) {
         throw new CacheException(e);
      } finally {
         resume(tx);
      }
   }
View Full Code Here

         }
         defineGenericDataTypeCacheConfigurations(settings, properties);
      } catch (CacheException ce) {
         throw ce;
      } catch (Throwable t) {
          throw new CacheException("Unable to start region factory", t);
      }
   }
View Full Code Here

            manager.getGlobalConfiguration().setExposeGlobalJmxStatistics(Boolean.parseBoolean(globalStats));
         }
         manager.start();
         return manager;
      } catch (IOException e) {
         throw new CacheException("Unable to create default cache manager", e);
      }
   }
View Full Code Here

      try {
          if (transactionManager != null) {
              tx = transactionManager.getTransaction();
          }
      } catch (SystemException se) {
          throw new CacheException("Could not obtain transaction", se);
      }
      return tx == null ? Thread.currentThread() : tx;
   }
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.