Package org.springmodules.cache.provider.tangosol

Examples of org.springmodules.cache.provider.tangosol.CoherenceCachingModel


    assertEquals(expectedCachedObject, entry);
  }

  private Object getCacheElement(int keyAndModelIndex) throws Exception {
    KeyAndModel keyAndModel = getKeyAndModel(keyAndModelIndex);
    CoherenceCachingModel model = (CoherenceCachingModel) keyAndModel.model;
    NamedCache cache = TangosolUtils.getNamedCache(model.getCacheName());
    return cache.get(keyAndModel.key);
  }
View Full Code Here


   * @see CacheModelParser#parseCachingModel(Element)
   */
  public CachingModel parseCachingModel(Element element) {
    String cacheName = element.getAttribute("cacheName");
   
    CoherenceCachingModel model = new CoherenceCachingModel(cacheName);
   
    String timeToLiveAttr = element.getAttribute("timeToLive");
    if (StringUtils.hasText(timeToLiveAttr)) {
      try {
        long timeToLive = Long.parseLong(timeToLiveAttr);
        model.setTimeToLive(timeToLive);
      }
      catch (NumberFormatException exception) {
        // ignore exception
      }
    }
View Full Code Here

    Element element = new DomElementStub("caching");
    element.setAttribute("cacheName", cacheName);
    element.setAttribute("timeToLive", "2");

    CachingModel actual = parser.parseCachingModel(element);
    CoherenceCachingModel expected = new CoherenceCachingModel(cacheName);
    expected.setTimeToLive(2l);
   
    assertEquals(expected, actual);
  }
View Full Code Here

TOP

Related Classes of org.springmodules.cache.provider.tangosol.CoherenceCachingModel

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.