Examples of CacheModelValidator


Examples of org.springmodules.cache.provider.CacheModelValidator

   * <code>{@link CoherenceFacade#modelValidator()}</code> returns an
   * an instance of <code>{@link CoherenceModelValidator}</code> not equal to
   * <code>null</code>.
   */
  public void testGetCacheModelValidator() {
    CacheModelValidator validator = facade.modelValidator();
    assertNotNull(validator);
    assertEquals(CoherenceModelValidator.class, validator.getClass());
  }
View Full Code Here

Examples of org.springmodules.cache.provider.CacheModelValidator

   * <code>{@link OsCacheFacade#modelValidator()}</code> returns an an
   * instance of <code>{@link OsCacheModelValidator}</code> not equal to
   * <code>null</code>.
   */
  public void testGetCacheModelValidator() {
    CacheModelValidator validator = osCacheFacade.modelValidator();

    assertNotNull(validator);

    assertEquals(OsCacheModelValidator.class, validator.getClass());
  }
View Full Code Here

Examples of org.springmodules.cache.provider.CacheModelValidator

    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

Examples of org.springmodules.cache.provider.CacheModelValidator

   * <code>{@link JcsFacade#modelValidator()}</code> returns an an
   * instance of <code>{@link JcsModelValidator}</code> not equal to
   * <code>null</code>.
   */
  public void testGetCacheModelValidator() {
    CacheModelValidator validator = jcsFacade.modelValidator();
    assertNotNull(validator);
    assertEquals(JcsModelValidator.class, validator.getClass());
  }
View Full Code Here

Examples of org.springmodules.cache.provider.CacheModelValidator

   * <code>{@link GigaSpacesFacade#modelValidator()}</code> returns an
   * an instance of <code>{@link GigaSpacesModelValidator}</code> not equal to
   * <code>null</code>.
   */
  public void testGetCacheModelValidator() {
    CacheModelValidator validator = facade.modelValidator();
    assertNotNull(validator);
    assertEquals(GigaSpacesModelValidator.class, validator.getClass());
  }
View Full Code Here

Examples of org.springmodules.cache.provider.CacheModelValidator

   * <code>{@link EhCacheFacade#modelValidator()}</code> returns an an
   * instance of <code>{@link EhCacheModelValidator}</code> not equal to
   * <code>null</code>.
   */
  public void testGetCacheModelValidator() {
    CacheModelValidator validator = cacheFacade.modelValidator();
    assertNotNull(validator);
    assertEquals(EhCacheModelValidator.class, validator.getClass());
  }
View Full Code Here

Examples of org.springmodules.cache.provider.CacheModelValidator

  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

Examples of org.springmodules.cache.provider.CacheModelValidator

   * <code>{@link JbossCacheFacade#modelValidator()}</code> returns an
   * an instance of <code>{@link JbossCacheModelValidator}</code> not equal to
   * <code>null</code>.
   */
  public void testGetCacheModelValidator() {
    CacheModelValidator validator = cacheFacade.modelValidator();
    assertNotNull(validator);
    assertEquals(JbossCacheModelValidator.class, validator.getClass());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.