Package org.infinispan.loader

Examples of org.infinispan.loader.CacheLoaderException


      s3Bucket.clear();
   }

   CacheLoaderException convertToCacheLoaderException(String message, Exception caught) {
      return (caught instanceof CacheLoaderException) ? (CacheLoaderException) caught :
            new CacheLoaderException(message, caught);
   }
View Full Code Here


      if (!(isCacheReady() && isLocalCall())) return null;
      ClusteredGetCommand clusteredGetCommand = new ClusteredGetCommand(key, cache.getName());
      List<Response> response = doRemoteCall(clusteredGetCommand);
      if (response.isEmpty()) return null;
      if (response.size() > 1)
         throw new CacheLoaderException("Response length is always 0 or 1, received: " + response);
      Response firstResponse = response.get(0);
      if (firstResponse.isSuccessful() && firstResponse instanceof SuccessfulResponse) {
         return (InternalCacheEntry) ((SuccessfulResponse) firstResponse).getResponseValue();
      }

      String message = "Unknown response from remote cache: " + response;
      log.error(message);
      throw new CacheLoaderException(message);
   }
View Full Code Here

      ResponseValidityFilter filter = new ResponseValidityFilter(rpcManager.getTransport().getMembers(), rpcManager.getLocalAddress());
      try {
         return rpcManager.invokeRemotely(null, clusteredGetCommand, ResponseMode.WAIT_FOR_VALID_RESPONSE, config.getRemoteCallTimeout(), false, filter, false);
      } catch (Exception e) {
         log.error("error while doing remote call", e);
         throw new CacheLoaderException(e);
      }
   }
View Full Code Here

                fos.flush();
                safeClose(fos);
                totalBytesRead = 0;
            }
        } catch (IOException e) {
            throw new CacheLoaderException("I/O error", e);
        } catch (ClassNotFoundException e) {
            throw new CacheLoaderException("Unexpected expcetion", e);
        }
    }
View Full Code Here

                }
                bis.close();
                fileInStream.close();
            }
        } catch (IOException e) {
            throw new CacheLoaderException("I/O expcetion while generating stream", e);
        }
    }
View Full Code Here

                ois = new ObjectInputStream(is);
                bucket = (Bucket) ois.readObject();
            } catch (Exception e) {
                String message = "Error while reading from file: " + bucketFile.getAbsoluteFile();
                log.error(message, e);
                throw new CacheLoaderException(message, e);
            } finally {
                safeClose(ois);
                safeClose(is);
            }
        }
View Full Code Here

                oos.writeObject(b);
                oos.flush();
                fos.flush();
            } catch (IOException ex) {
                log.error("Exception while saving bucket " + b, ex);
                throw new CacheLoaderException(ex);
            }
            finally {
                safeClose(oos);
                safeClose(fos);
            }
View Full Code Here

      try {
         return marshaller.objectToBuffer(bucket);
      } catch (IOException e) {
         String message = "I/O failure while marshalling " + bucket;
         log.error(message, e);
         throw new CacheLoaderException(message, e);
      }
   }
View Full Code Here

      try {
         return marshaller.objectFromStream(inputStream);
      } catch (IOException e) {
         String message = "I/O error while unmarshalling from stram";
         log.error(message, e);
         throw new CacheLoaderException(message, e);
      } catch (ClassNotFoundException e) {
         String message = "*UNEXPECTED* ClassNotFoundException. This should not happen as Bucket class exists";
         log.error(message, e);
         throw new CacheLoaderException(message, e);
      }
   }
View Full Code Here

      assrtNotNull(timestampColumnName, "timestampColumnName needed in order to create table");
      assrtNotNull(timestampColumnType, "timestampColumnType needed in order to create table");
   }

   private void assrtNotNull(String keyColumnType, String message) throws CacheLoaderException {
      if (keyColumnType == null || keyColumnType.trim().length() == 0) throw new CacheLoaderException(message);
   }
View Full Code Here

TOP

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