Package org.infinispan

Examples of org.infinispan.CacheException


      try {
         for (Thread thread : threads) {
            thread.join(defaultConfiguration.getLockAcquisitionTimeout());
         }
      } catch (InterruptedException e) {
         throw new CacheException("Interrupted while waiting for the caches to start");
      }

      return this;
   }
View Full Code Here


            transport.invokeRemotely(null, cmd, ResponseMode.SYNCHRONOUS, c.getSyncReplTimeout(), false, null, false);
         }
         // Once sent to the cluster, remove the local cache
         cmd.perform(null);
      } catch (Throwable t) {
         throw new CacheException("Error removing cache", t);
      }
   }
View Full Code Here

    */
   private Cache wireCache(String cacheName) {
      boolean acquired = false;
      try {
         if (!cacheCreateLock.tryLock(defaultConfiguration.getLockAcquisitionTimeout(), MILLISECONDS)) {
            throw new CacheException("Unable to acquire lock on cache with name " + cacheName);
         }
         acquired = true;
         CacheWrapper existingCache = caches.get(cacheName);
         if (existingCache != null)
            return null;

         Configuration c = getConfiguration(cacheName);
         setConfigurationName(cacheName, c);

         c.setGlobalConfiguration(globalConfiguration);
         c.accept(configurationValidator);
         c.assertValid();
         Cache cache = new InternalCacheFactory().createCache(c, globalComponentRegistry, cacheName, reflectionCache);
         CacheWrapper cw = new CacheWrapper(cache);
         existingCache = caches.put(cacheName, cw);
         if (existingCache != null) {
            throw new IllegalStateException("attempt to initialize the cache twice");
         }

         // start the global components here, while we have the global lock
         globalComponentRegistry.start();

         return cache;
      } catch (InterruptedException e) {
         Thread.currentThread().interrupt();
         throw new CacheException("Interrupted while trying to get lock on cache with cache name " + cacheName, e);
      } finally {
         if (acquired)
            cacheCreateLock.unlock();
      }
   }
View Full Code Here

               latch.await(180, TimeUnit.SECONDS);
               log.info("Wait finished, return the cache");
               return super.getCache();
            } catch (InterruptedException e) {
               Thread.currentThread().interrupt();
               throw new CacheException(e);
            }
         }
         return super.getCache();
      }
View Full Code Here

            if (isStatisticsEnabled()) replicationFailures.incrementAndGet();
            throw e;
         } catch (Throwable th) {
            log.error("unexpected error while replicating", th);
            if (isStatisticsEnabled()) replicationFailures.incrementAndGet();
            throw new CacheException(th);
         } finally {
            if (statisticsEnabled) {
               long timeTaken = System.currentTimeMillis() - startTime;
               totalReplicationTime.getAndAdd(timeTaken);
            }
View Full Code Here

            if (marshallable != null && !marshallable.externalizer().equals(Externalizer.class)) {
               int id = marshallable.id();
               Externalizer ext = null;
               ext = Util.getInstance(marshallable.externalizer());
               if (!ids.add(id))
                  throw new CacheException("Duplicate id found! id=" + id + " in " + ext.getClass().getName() + " is shared by another marshallable class.");
               if (ext instanceof ReplicableCommandExternalizer) {
                  ((ReplicableCommandExternalizer) ext).inject(cmdFactory);
               }
               if (ext instanceof MarshalledValue.Externalizer) {
                  ((MarshalledValue.Externalizer) ext).inject(ispnMarshaller);
View Full Code Here

            if (Thread.currentThread().isInterrupted())
               throw new IOException("Cache manager is shutting down, " +
                     "so type (id=" + readerIndex + ") cannot be resolved. Interruption being pushed up.", new InterruptedException());
            else
               throw new CacheException("Cache manager is either starting up or shutting down but it's not interrupted, " +
                     "so type (id=" + readerIndex + ") cannot be resolved.");
         } else {
            if (log.isTraceEnabled()) {
               log.trace("Unknown type. Input stream has {0} to read", input.available());
               log.trace("Check contents of read externalizers: {0}", readers);
            }

            throw new CacheException("Type of data read is unknown. Id=" + readerIndex + " " +
                  "is not amongst known reader indexes.");
         }
      }

      return adapter.readObject(input);
View Full Code Here

   public void purge() {
      CacheStore cs = getCacheStore();
      if (cs != null) try {
         cs.clear();
      } catch (CacheLoaderException e) {
         throw new CacheException("Unable to purge cache store", e);
      }
   }
View Full Code Here

         try {
            loader = createCacheLoader();
            if (loader != null) loader.start();
            purgeLoaders(false);
         } catch (Exception e) {
            throw new CacheException("Unable to start cache loaders", e);
         }
      }
   }
View Full Code Here

            }
            Set<InternalCacheEntry> state;
            try {
               state = loadState();
            } catch (CacheLoaderException e) {
               throw new CacheException("Unable to preload!", e);
            }

            for (InternalCacheEntry e : state) {
               if (clmConfig.isShared() || !(loader instanceof ChainingCacheStore)) {
                  cache.getAdvancedCache()
View Full Code Here

TOP

Related Classes of org.infinispan.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.