Package org.springmodules.cache.provider.jcs

Examples of org.springmodules.cache.provider.jcs.JcsFlushingModel


   * @see AbstractCacheModelParser#doParseFlushingModel(Element, boolean)
   */
  protected FlushingModel doParseFlushingModel(Element element,
      boolean flushBeforeMethodExecution) {

    JcsFlushingModel model = new JcsFlushingModel();

    List cacheElements = DomUtils.getChildElementsByTagName(element, "cache");
    if (!CollectionUtils.isEmpty(cacheElements)) {
      int count = cacheElements.size();
      CacheStruct[] cacheStructs = new CacheStruct[count];

      for (int i = 0; i < count; i++) {
        Element cacheElement = (Element) cacheElements.get(i);
        String cacheName = cacheElement.getAttribute("name");
        String groups = cacheElement.getAttribute("groups");

        CacheStruct cache = new CacheStruct(cacheName, groups);
        cacheStructs[i] = cache;
      }

      model.setCacheStructs(cacheStructs);
    }

    model.setFlushBeforeMethodExecution(flushBeforeMethodExecution);
    return model;
  }
View Full Code Here


    element.appendChild(createCacheElement("cacheTwo", "services,web"));

    CacheStruct[] cacheStructs = { new CacheStruct("cacheOne", "pojos,daos"),
        new CacheStruct("cacheTwo", "services,web") };

    JcsFlushingModel expected = new JcsFlushingModel();
    expected.setCacheStructs(cacheStructs);
    expected.setFlushBeforeMethodExecution(true);

    FlushingModel actual = parser.doParseFlushingModel(element,
        flushBeforeMethodExecution);

    assertEquals(expected, actual);
View Full Code Here

    Element element = new DomElementStub("flushing");
    element.appendChild(createCacheElement(cacheName, groups));

    FlushingModel actual = parser.doParseFlushingModel(element,
        flushBeforeMethodExecution);
    JcsFlushingModel expected = new JcsFlushingModel();
    expected.setCacheStruct(new CacheStruct(cacheName, groups));
    expected.setFlushBeforeMethodExecution(flushBeforeMethodExecution);

    assertEquals(expected, actual);
  }
View Full Code Here

    Element element = new DomElementStub("flushing");

    FlushingModel actual = parser.doParseFlushingModel(element,
        flushBeforeMethodExecution);
    JcsFlushingModel expected = new JcsFlushingModel();
    expected.setFlushBeforeMethodExecution(flushBeforeMethodExecution);

    assertEquals(expected, actual);
  }
View Full Code Here

TOP

Related Classes of org.springmodules.cache.provider.jcs.JcsFlushingModel

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.