Package org.infinispan

Examples of org.infinispan.CacheException


               return executeCommand((CacheRpcCommand) cmd, req);
            else
               return cmd.perform(null);
         } catch (InterruptedException e) {
            log.warnf("Shutdown while handling command %s", cmd);
            return new ExceptionResponse(new CacheException("Cache is shutting down"));
         } catch (Throwable x) {
            if (cmd == null)
               log.warnf(x, "Problems unmarshalling remote command from byte buffer");
            else
               log.warnf(x, "Problems invoking command %s", cmd);
            return new ExceptionResponse(new CacheException("Problems invoking command.", x));
         }
      } else {
         return null;
      }
   }
View Full Code Here


   private void abortIfRemoteTransactionInvalid(TxInvocationContext ctx, AbstractTransactionBoundaryCommand c) {
      // this check fixes ISPN-777
      if (!ctx.isOriginLocal()) {
         Address origin = c.getGlobalTransaction().getAddress();
         if (!transport.getMembers().contains(origin))
            throw new CacheException("Member " + origin + " no longer in cluster. Forcing tx rollback for " + c.getGlobalTransaction());
      }
   }
View Full Code Here

            return null;
         case DRAIN_TX_PREPARES:
            for (PrepareCommand pc : pendingPrepares) pc.perform(null);
            return null;
      }
      throw new CacheException("Unknown rehash control command type " + type);
   }
View Full Code Here

                     commandFactories.put(id, fact);
                     commandInitializers.put(id, initClazz);
                     moduleCommands.add(entry.getValue());
                  }
               } catch (Exception e) {
                  throw new CacheException("Unable to load factory class " + factClass + " for module " + module.getKey());
               }
            }
         }
      } catch (IOException ioe) {
         commandInitializers = Collections.emptyMap();
         commandFactories = Collections.emptyMap();
         throw new CacheException("IO Exception reading module properties file!", ioe);
      }
   }
View Full Code Here

      try {
         if (cacheCreateLock.tryLock(defaultConfiguration.getLockAcquisitionTimeout(), MILLISECONDS)) {
            acquired = true;
            return createCache(cacheName);
         } else {
            throw new CacheException("Unable to acquire lock on cache with name " + cacheName);
         }
      } 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

            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

      try {
         method.setAccessible(true);
         return method.invoke(instance, parameters);
      }
      catch (Exception e) {
         throw new CacheException("Unable to invoke method " + method + " on object " + //instance +
               (parameters != null ? " with parameters " + Arrays.asList(parameters) : ""), e);
      }
   }
View Full Code Here

    * @param fieldName name of field to retrieve
    * @return a value
    */
   public static Object getValue(Object instance, String fieldName) {
      Field f = findFieldRecursively(instance.getClass(), fieldName);
      if (f == null) throw new CacheException("Could not find field named '" + fieldName + "' on instance " + instance);
      try {
         f.setAccessible(true);
         return f.get(instance);
      }
      catch (IllegalAccessException iae) {
         throw new CacheException("Cannot access field " + f, iae);
      }
   }
View Full Code Here

         if(transactionSynchronizationRegistry != null) {
            try {
               transactionSynchronizationRegistry.registerInterposedSynchronization(sync);
            } catch (Exception e) {
               log.failedSynchronizationRegistration(e);
               throw new CacheException(e);
            }

         } else {

            try {
               transaction.registerSynchronization(sync);
            } catch (Exception e) {
               log.failedSynchronizationRegistration(e);
               throw new CacheException(e);
            }
         }
         ((SyncLocalTransaction) localTransaction).setEnlisted(true);
      }
   }
View Full Code Here

            if (isStatisticsEnabled()) replicationFailures.incrementAndGet();
            throw e;
         } catch (Throwable th) {
            log.unexpectedErrorReplicating(th);
            if (isStatisticsEnabled()) replicationFailures.incrementAndGet();
            throw new CacheException(th);
         } finally {
            if (statisticsEnabled) {
               long timeTaken = System.currentTimeMillis() - startTime;
               totalReplicationTime.getAndAdd(timeTaken);
            }
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.