Examples of CoherenceCachingModel


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

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

   * @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

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

    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
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.