Package org.infinispan.cli.interpreter.result

Examples of org.infinispan.cli.interpreter.result.StatementException


   @Override
   public Result execute(Session session) throws StatementException {
      TransactionManager tm = getTransactionManager(session);
      if (tm==null) {
         throw new StatementException("Cannot retrieve a transaction manager for the cache");
      }
      try {
         tm.begin();
         return EmptyResult.RESULT;
      } catch (NotSupportedException e) {
         throw new StatementException("The TransactionManager does not support nested transactions");
      } catch (SystemException e) {
         throw new StatementException("Unexpected error while starting transaction: "+e.getMessage());
      }
   }
View Full Code Here


      DistributionManager distributionManager = cache.getAdvancedCache().getDistributionManager();
      if(distributionManager!=null) {
         List<Address> addresses = distributionManager.locate(keyData.getKey());
         return new StringResult(addresses.toString());
      } else {
         throw new StatementException("Cache is not distributed");
      }
   }
View Full Code Here

   @Override
   public Result execute(Session session) throws StatementException {
      TransactionManager tm = getTransactionManager(session);
      if (tm==null) {
         throw new StatementException("Cannot retrieve a transaction manager for the cache");
      }
      try {
         tm.commit();
         return EmptyResult.RESULT;
      } catch (Exception e) {
         throw new StatementException("Cannot commit transaction: "+e.getMessage());
      }
   }
View Full Code Here

   @Override
   public Result execute(Session session) throws StatementException {
      TransactionManager tm = getTransactionManager(session);
      if (tm == null) {
         throw new StatementException("Cannot retrieve a transaction manager for the cache");
      }
      try {
         tm.rollback();
         return EmptyResult.RESULT;
      } catch (Exception e) {
         throw new StatementException("Cannot rollback transaction: " + e.getMessage());
      }
   }
View Full Code Here

         for (Option option : options) {
            if ("container".equals(option.getName())) {
               printContainerStats(pw, (DefaultCacheManager) session.getCacheManager());
               pw.flush();
            } else {
               throw new StatementException("Unkown option: " + option);
            }
         }
      } else {
         printCacheStats(pw, session.getCache(cacheName));
      }
View Full Code Here

      pw.println("}");
   }

   private void printCacheStats(PrintWriter pw, Cache<?, ?> cache) throws StatementException {
      if (!cache.getCacheConfiguration().jmxStatistics().enabled()) {
         throw new StatementException("Statistics are not enabled for the specified cache");
      }

      for (CommandInterceptor interceptor : cache.getAdvancedCache().getInterceptorChain()) {
         printComponentStats(pw, cache, interceptor);
      }
View Full Code Here

      DistributionManager distributionManager = cache.getAdvancedCache().getDistributionManager();
      if(distributionManager!=null) {
         List<Address> addresses = distributionManager.locate(keyData.getKey());
         return new StringResult(addresses.toString());
      } else {
         throw new StatementException("Cache is not distributed");
      }
   }
View Full Code Here

      RollingUpgradeManager upgradeManager = cache.getAdvancedCache().getComponentRegistry().getComponent(RollingUpgradeManager.class);
      for (Option opt : options) {
         if ("dumpkeys".equals(opt.getName())) {
            upgradeManager.recordKnownGlobalKeyset();
         } else {
            throw new StatementException("Unknown option "+opt.getName());
         }
      }

      return EmptyResult.RESULT;
   }
View Full Code Here

   @Override
   public Result execute(Session session) throws StatementException {
      TransactionManager tm = getTransactionManager(session);
      if (tm==null) {
         throw new StatementException("Cannot retrieve a transaction manager for the cache");
      }
      try {
         tm.commit();
         return EmptyResult.RESULT;
      } catch (Exception e) {
         throw new StatementException("Cannot commit transaction: "+e.getMessage());
      }
   }
View Full Code Here

   @Override
   public Result execute(Session session) throws StatementException {
      TransactionManager tm = getTransactionManager(session);
      if (tm == null) {
         throw new StatementException("Cannot retrieve a transaction manager for the cache");
      }
      try {
         tm.rollback();
         return EmptyResult.RESULT;
      } catch (Exception e) {
         throw new StatementException("Cannot rollback transaction: " + e.getMessage());
      }
   }
View Full Code Here

TOP

Related Classes of org.infinispan.cli.interpreter.result.StatementException

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.