Package org.springmodules.cache

Examples of org.springmodules.cache.FatalCacheException


          key = (String) i.next();
          FlushingModel model = (FlushingModel) flushingModels.get(key);
          newSource.addModel(model, key);
        }
      } catch (Exception exception) {
        throw new FatalCacheException(
            "Unable to add model stored under the key "
                + StringUtils.quote(key), exception);
      }
      setFlushingModelSource(newSource);
    }
View Full Code Here


      } catch (Exception exception) {
        String errorMessage = "Unable to create instance of "
            + annotationsParserClassName
            + ". Unable to load parser for namespace 'annotations'";
        throw new FatalCacheException(errorMessage, exception);
      }

    } else {
      logger.info("No support for JDK 1.5 Annotations. "
          + "Unable to load parser for namespace 'annotations'");
View Full Code Here

   * @see InitializingBean#afterPropertiesSet()
   * @see #onAfterPropertiesSet()
   */
  public final void afterPropertiesSet() throws FatalCacheException {
    if (cacheProviderFacade == null) {
      throw new FatalCacheException(
          "The cache provider facade should not be null");
    }

    if (flushingModels == null || flushingModels.isEmpty()) {
      return;
    }

    CacheModelValidator validator = cacheProviderFacade
        .modelValidator();

    if (flushingModels instanceof Properties) {
      PropertyEditor editor = cacheProviderFacade.getFlushingModelEditor();
      Properties properties = (Properties) flushingModels;
      Map newFlushingModels = new HashMap();

      String id = null;

      try {
        for (Iterator i = properties.keySet().iterator(); i.hasNext();) {
          id = (String) i.next();

          String property = properties.getProperty(id);
          editor.setAsText(property);
          Object flushingModel = editor.getValue();
          validator.validateFlushingModel(flushingModel);

          newFlushingModels.put(id, flushingModel);
        }
      } catch (Exception exception) {
        throw new FatalCacheException(
            "Unable to create the flushing model with id "
                + StringUtils.quote(id), exception);
      }

      setFlushingModels(newFlushingModels);

    } else {
      String id = null;

      try {
        for (Iterator i = flushingModels.keySet().iterator(); i.hasNext();) {
          id = (String) i.next();
          Object flushingModel = flushingModels.get(id);
          validator.validateFlushingModel(flushingModel);
        }
      } catch (Exception exception) {
        throw new FatalCacheException(
            "Unable to validate flushing model with id "
                + StringUtils.quote(id), exception);
      }
    }

View Full Code Here

          key = (String) entry.getKey();
          newSource.addModel((CachingModel) entry.getValue(), key);
        }

      } catch (Exception exception) {
        throw new FatalCacheException(
            "Unable to add model stored under the key "
                + StringUtils.quote(key), exception);
      }

      setCachingModelSource(newSource);
View Full Code Here

   * @throws FatalCacheException if the cache manager is <code>null</code>
   */
  protected final void assertCacheManagerIsNotNull(Object cacheManager)
      throws FatalCacheException {
    if (cacheManager == null) {
      throw new FatalCacheException("The cache manager should not be null");
    }
  }
View Full Code Here

    return NULL_ENTRY.equals(obj) ? null : obj;
  }

  private void validateCache() throws FatalCacheException {
    if (cache == null)
      throw new FatalCacheException(
          "The cache provider facade should not be null");
  }
View Full Code Here

          "The cache provider facade should not be null");
  }

  private void validateModels() throws FatalCacheException {
    if (CollectionUtils.isEmpty(modelMap))
      throw new FatalCacheException(
          "The map of caching models should not be empty");

    CacheModelValidator validator = cache.modelValidator();
    String id = null;
    try {
      for (Iterator i = modelMap.keySet().iterator(); i.hasNext();) {
        id = (String) i.next();
        validator.validateCachingModel(modelMap.get(id));
      }
    } catch (Exception exception) {
      throw new FatalCacheException("Unable to validate caching model with id "
          + StringUtils.quote(id), exception);
    }
  }
View Full Code Here

TOP

Related Classes of org.springmodules.cache.FatalCacheException

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.