Package org.infinispan.lifecycle

Examples of org.infinispan.lifecycle.ComponentStatus


   public LuceneLockFactory(Cache<CacheKey, Object> cache, String indexName) {
      this.cache = cache;
      this.indexName = indexName;
      tm = cache.getAdvancedCache().getTransactionManager();
      if (tm == null) {
         ComponentStatus status = cache.getAdvancedCache().getComponentRegistry().getStatus();
         if (status.equals(ComponentStatus.RUNNING)) {
            throw new CacheException(
                     "Failed looking up TransactionManager. Check if any transaction manager is associated with Infinispan cache: \'"
                              + cache.getName() + "\'");
         }
         else {
View Full Code Here


   public TransactionalLockFactory(Cache cache, String indexName) {
      this.cache = cache;
      this.indexName = indexName;
      tm = cache.getAdvancedCache().getTransactionManager();
      if (tm == null) {
         ComponentStatus status = cache.getAdvancedCache().getComponentRegistry().getStatus();
         if (status.equals(ComponentStatus.RUNNING)) {
            throw new CacheException(
                     "Failed looking up TransactionManager. Check if any transaction manager is associated with Infinispan cache: \'"
                              + cache.getName() + "\'");
         }
         else {
View Full Code Here

   }

   private Object handleAll(InvocationContext ctx, VisitableCommand command) throws Throwable {
      boolean suppressExceptions = false;

      ComponentStatus status = componentRegistry.getStatus();
      if (command.ignoreCommandOnStatus(status)) {
         log.debugf("Status: %s : Ignoring %s command", status, command);
         return null;
      }

      if (status.isTerminated()) {
         throw new IllegalStateException(String.format(
               "%s is in 'TERMINATED' state and so it does not accept new invocations. " +
                     "Either restart it or recreate the cache container.",
               getCacheNamePrefix()));
      } else if (stoppingAndNotAllowed(status, ctx)) {
View Full Code Here

   public TransactionalLockFactory(Cache cache, String indexName) {
      this.cache = cache;
      this.indexName = indexName;
      tm = cache.getAdvancedCache().getTransactionManager();
      if (tm == null) {
         ComponentStatus status = cache.getAdvancedCache().getComponentRegistry().getStatus();
         if (status.equals(ComponentStatus.RUNNING)) {
            throw new CacheException(
                     "Failed looking up TransactionManager. Check if any transaction manager is associated with Infinispan cache: \'"
                              + cache.getName() + "\'");
         }
         else {
View Full Code Here

   }

   private Object handleAll(InvocationContext ctx, VisitableCommand command) throws Throwable {
      boolean suppressExceptions = false;

      ComponentStatus status = componentRegistry.getStatus();
      if (command.ignoreCommandOnStatus(status)) {
         log.debugv("Status: %s : Ignoring %s command", status, command);
         return null;
      }

      if (status.isTerminated()) {
         throw new IllegalStateException(String.format(
               "%s is in 'TERMINATED' state and so it does not accept new invocations. " +
                     "Either restart it or recreate the cache container.",
               getCacheNamePrefix()));
      } else if (stoppingAndNotAllowed(status, ctx)) {
View Full Code Here

   public TransactionalLockFactory(Cache cache, String indexName) {
      this.cache = cache;
      this.indexName = indexName;
      tm = cache.getAdvancedCache().getTransactionManager();
      if (tm == null) {
         ComponentStatus status = cache.getAdvancedCache().getComponentRegistry().getStatus();
         if (status.equals(ComponentStatus.RUNNING)) {
            throw new CacheException(
                     "Failed looking up TransactionManager. Check if any transaction manager is associated with Infinispan cache: \'"
                              + cache.getName() + "\'");
         }
         else {
View Full Code Here

   }

   private Object handleAll(InvocationContext ctx, VisitableCommand command) throws Throwable {
      boolean suppressExceptions = false;

      ComponentStatus status = componentRegistry.getStatus();
      if (status.isTerminated()) {
         String cacheName = componentRegistry.getCacheName();
         String prefix = "Cache '" + cacheName + "'";
         if (cacheName.equals(CacheContainer.DEFAULT_CACHE_NAME))
            prefix = "Default cache";
         throw new IllegalStateException(prefix + " is in 'TERMINATED' state and so it does not accept new invocations. Either restart it or recreate the cache container.");
View Full Code Here

        assertSame(expected, result);
    }

    @Test
    public void getStatus() {
        ComponentStatus expected = ComponentStatus.INITIALIZING;
        when(this.manager.getStatus()).thenReturn(expected);

        ComponentStatus result = this.subject.getStatus();

        assertSame(expected, result);
    }
View Full Code Here

      return retval == null ? false : retval;
   }

   private Object handleAll(InvocationContext ctx, VisitableCommand command) throws Throwable {
      try {
         ComponentStatus status = componentRegistry.getStatus();
         if (command.ignoreCommandOnStatus(status)) {
            log.debugf("Status: %s : Ignoring %s command", status, command);
            return null;
         }

         if (status.isTerminated()) {
            throw log.cacheIsTerminated(getCacheNamePrefix());
         } else if (stoppingAndNotAllowed(status, ctx)) {
            throw log.cacheIsStopping(getCacheNamePrefix());
         }
View Full Code Here

   public TransactionalLockFactory(Cache<?, ?> cache, String indexName) {
      this.cache = cache;
      this.indexName = indexName;
      tm = cache.getAdvancedCache().getTransactionManager();
      if (tm == null) {
         ComponentStatus status = cache.getAdvancedCache().getComponentRegistry().getStatus();
         if (status.equals(ComponentStatus.RUNNING)) {
            throw new CacheException(
                     "Failed looking up TransactionManager. Check if any transaction manager is associated with Infinispan cache: \'"
                              + cache.getName() + "\'");
         }
         else {
View Full Code Here

TOP

Related Classes of org.infinispan.lifecycle.ComponentStatus

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.