Package org.infinispan.loaders

Examples of org.infinispan.loaders.CacheLoaderException


   }

   private void enforceTwoWayMapper(String where) throws CacheLoaderException {
      if (!(key2StringMapper instanceof TwoWayKey2StringMapper)) {
         log.invalidKey2StringMapper(where, key2StringMapper.getClass().getName());
         throw new CacheLoaderException(String.format("Invalid key to string mapper", key2StringMapper.getClass().getName()));
      }
   }
View Full Code Here


            InternalCacheValue icv = (InternalCacheValue) JdbcUtil.unmarshall(getMarshaller(), inputStream);
            storedEntry = icv.toInternalCacheEntry(key);
         }
      } catch (SQLException e) {
         log.sqlFailureReadingKey(key, lockingKey, e);
         throw new CacheLoaderException(String.format(
               "SQL error while fetching stored entry with key: %s, lockingKey: %s",
               key, lockingKey), e);
      } finally {
         JdbcUtil.safeClose(rs);
         JdbcUtil.safeClose(ps);
View Full Code Here

   // not private so that this can be unit tested

   File verifyOrCreateEnvironmentDirectory(File location) throws CacheLoaderException {
      if (!location.exists()) {
         boolean created = location.mkdirs();
         if (!created) throw new CacheLoaderException("Unable to create cache loader location " + location);

      }
      if (!location.isDirectory()) {
         throw new CacheLoaderException("Cache loader location [" + location + "] is not a directory!");
      }
      return location;
   }
View Full Code Here

   private void closeEnvironment() throws CacheLoaderException {
      if (env != null) {
         try {
            env.close();
         } catch (DatabaseException e) {
            throw new CacheLoaderException("Unexpected exception closing cacheStore", e);
         }
      }
      env = null;
   }
View Full Code Here

    * @return CacheLoaderException with the correct cause
    */
   CacheLoaderException convertToCacheLoaderException(String message, Exception caught) {
      caught = ExceptionUnwrapper.unwrap(caught);
      return (caught instanceof CacheLoaderException) ? (CacheLoaderException) caught :
            new CacheLoaderException(message, caught);
   }
View Full Code Here

            remove(key);
            return null;
         }
         return ice;
      } catch (IOException e) {
         throw new CacheLoaderException(e);
      } catch (ClassNotFoundException e) {
         throw new CacheException(e);
      }
   }
View Full Code Here

         FastIterator fi = tree.keys();
         Object o;
         while ((o = fi.next()) != null) if (keysToExclude == null || !keysToExclude.contains(o)) s.add(o);
         return s;
      } catch (IOException e) {
         throw new CacheLoaderException(e);
      }
   }
View Full Code Here

      try {
         recman.delete(tree.getRecid());
         recman.delete(expiryTree.getRecid());
         createTree();
      } catch (IOException e) {
         throw new CacheLoaderException(e);
      }
   }
View Full Code Here

   private void commit() throws CacheLoaderException {
      try {
         recman.commit();
      } catch (IOException e) {
         throw new CacheLoaderException(e);
      }
   }
View Full Code Here

      try {
         tree.put(key, marshall(entry));
         if (entry.canExpire())
            addNewExpiry(entry);
      } catch (IOException e) {
         throw new CacheLoaderException(e);
      } catch (InterruptedException ie) {
         if (trace) log.trace("Interrupted while marshalling entry");
         Thread.currentThread().interrupt();
      }
   }
View Full Code Here

TOP

Related Classes of org.infinispan.loaders.CacheLoaderException

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.