Package org.infinispan.persistence

Examples of org.infinispan.persistence.CacheLoaderException


         } finally {
            // in case we replaced or evicted an entry, add to freeList
            free(fe);
         }
      } catch (Exception e) {
         throw new CacheLoaderException(e);
      }
   }
View Full Code Here


               file.write(ByteBuffer.wrap(MAGIC), 0);
               filePos = MAGIC.length;
            }
         }
      } catch (Exception e) {
         throw new CacheLoaderException(e);
      }
   }
View Full Code Here

      try {
         FileEntry fe = entries.remove(key);
         free(fe);
         return fe != null;
      } catch (Exception e) {
         throw new CacheLoaderException(e);
      }
   }
View Full Code Here

         // load serialized data from disk
         data = new byte[fe.keyLen + (loadValue ? fe.dataLen : 0) + (loadMetadata ? fe.metadataLen : 0)];
         file.read(ByteBuffer.wrap(data), fe.offset + KEY_POS);
      } catch (Exception e) {
         throw new CacheLoaderException(e);
      } finally {
         // no need to keep the lock for deserialization
         fe.unlock();
      }
View Full Code Here

                  if (fe.isExpired(now)) {
                     it.remove();
                     try {
                        free(fe);
                     } catch (Exception e) {
                        throw new CacheLoaderException(e);
                     }
                     if (task != null) task.entryPurged(next.getKey());
                  }
               }
            }
View Full Code Here

      Response response;
      if (responses.size() > 1) {
         // Remove duplicates before deciding if multiple responses were received
         Set<Response> setResponses = new HashSet<Response>(responses);
         if (setResponses.size() > 1)
            throw new CacheLoaderException(String.format(
                  "Responses contains more than 1 element and these elements are not equal, so can't decide which one to use: %s",
                  setResponses));
         response = setResponses.iterator().next();
      } else {
         response = responses.iterator().next();
      }

      if (response.isSuccessful() && response instanceof SuccessfulResponse) {
         InternalCacheValue value = (InternalCacheValue) ((SuccessfulResponse) response).getResponseValue();
         return new MarshalledEntryImpl(key, value.getValue(), null, ctx.getMarshaller());
      }

      log.unknownResponsesFromRemoteCache(responses);
      throw new CacheLoaderException("Unknown responses");
   }
View Full Code Here

         RpcOptions options = rpcManager.getRpcOptionsBuilder(ResponseMode.WAIT_FOR_VALID_RESPONSE)
               .timeout(configuration.remoteCallTimeout(), TimeUnit.MILLISECONDS).responseFilter(filter).build();
         return rpcManager.invokeRemotely(null, clusteredGetCommand, options).values();
      } catch (Exception e) {
         log.errorDoingRemoteCall(e);
         throw new CacheLoaderException(e);
      }
   }
View Full Code Here

      PooledConnectionFactoryConfiguration pooledConfiguration;
      if (config instanceof PooledConnectionFactoryConfiguration) {
         pooledConfiguration = (PooledConnectionFactoryConfiguration) config;
      }
      else {
         throw new CacheLoaderException("ConnectionFactoryConfiguration passed in must be an instance of " +
               "PooledConnectionFactoryConfiguration");
      }
      pooledDataSource = new ComboPooledDataSource();
      pooledDataSource.setProperties(new Properties());
      try {
         /* Since c3p0 does not throw an exception when it fails to load a driver we attempt to do so here
          * Also, c3p0 does not allow specifying a custom classloader, so use c3p0's
          */
         Class.forName(pooledConfiguration.driverClass(), true, ComboPooledDataSource.class.getClassLoader());
         pooledDataSource.setDriverClass(pooledConfiguration.driverClass()); //loads the jdbc driver
      } catch (Exception e) {
         log.errorInstantiatingJdbcDriver(pooledConfiguration.driverClass(), e);
         throw new CacheLoaderException(String.format(
               "Error while instatianting JDBC driver: '%s'", pooledConfiguration.driverClass()), e);
      }
      pooledDataSource.setJdbcUrl(pooledConfiguration.connectionUrl());
      pooledDataSource.setUser(pooledConfiguration.username());
      pooledDataSource.setPassword(pooledConfiguration.password());
View Full Code Here

         logBefore(true);
         Connection connection = pooledDataSource.getConnection();
         logAfter(connection, true);
         return connection;
      } catch (SQLException e) {
         throw new CacheLoaderException("Failed obtaining connection from PooledDataSource", e);
      }
   }
View Full Code Here

         if (log.isTraceEnabled()) {
            log.tracef("Successfully removed %d rows.", result);
         }
      } catch (SQLException ex) {
         log.failedClearingJdbcCacheStore(ex);
         throw new CacheLoaderException("Failed clearing cache store", ex);
      } finally {
         JdbcUtil.safeClose(ps);
         connectionFactory.releaseConnection(conn);
      }
   }
View Full Code Here

TOP

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