Package org.springmodules.cache.provider.jcs.JcsFlushingModel

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


          "There should be at least one cache to flush");
    }

    int structCount = structs.length;
    for (int i = 0; i < structCount; i++) {
      CacheStruct struct = structs[i];
      if (!StringUtils.hasText(struct.getCacheName())) {
        throw new InvalidCacheModelException(
            "Cache name should not be empty in the struct with index <" + i
                + ">");
      }
    }
View Full Code Here


    Serializable[] keys = updateCache();

    int entryToRemoveIndex = 0;
    CacheEntry entryToRemove = cacheEntries[entryToRemoveIndex];

    flushingModel.setCacheStruct(new CacheStruct(CACHE_NAME,
        entryToRemove.group));
    jcsFacade.onFlushCache(flushingModel);

    int cacheElementCount = keys.length;
    for (int i = 0; i < cacheElementCount; i++) {
View Full Code Here

    String cacheName = "rebels";
    String[] groups = { "endor", "hoth" };
    struct.setCacheName(cacheName);
    struct.setGroups(groups);

    CacheStruct struct2 = new CacheStruct(cacheName, groups);
    assertEqualsHashCodeRelationshipIsCorrect(struct, struct2);

    cacheName = null;
    groups = new String[0];
    struct.setCacheName(cacheName);
    struct.setGroups(groups);

    struct2.setCacheName(cacheName);
    struct2.setGroups(groups);
    assertEqualsHashCodeRelationshipIsCorrect(struct, struct2);
  }
View Full Code Here

    String groups = "deathstar,stardestroyer";

    struct.setCacheName(cacheName);
    struct.setGroups(groups);

    CacheStruct struct2 = new CacheStruct(cacheName, groups);
    assertEquals(struct, struct2);

    struct2.setGroups((String) null);
    assertFalse(struct.equals(struct2));

    struct2.setCacheName(null);
    struct2.setGroups(groups);
    assertFalse(struct.equals(struct2));
  }
View Full Code Here

    String groups = "deathstar,stardestroyer";

    struct.setCacheName(cacheName);
    struct.setGroups(groups);

    CacheStruct struct2 = new CacheStruct(cacheName, groups);
    assertEqualsIsSymmetric(struct, struct2);
  }
View Full Code Here

    String groups = "deathstar,stardestroyer";

    struct.setCacheName(cacheName);
    struct.setGroups(groups);

    CacheStruct struct2 = new CacheStruct(cacheName, groups);
    CacheStruct struct3 = new CacheStruct(cacheName, groups);

    assertEqualsIsTransitive(struct, struct2, struct3);
  }
View Full Code Here

        + "[cacheName='androids', groups={'c3p0'}]";
    assertEquals(struct.toString(), actual);
  }

  protected void setUp() {
    struct = new CacheStruct();
  }
View Full Code Here

    assertEquals(new JcsFlushingModel(), editor.getValue());
  }

  public void testSetAsTextWithText() {
    editor.setAsText("cacheName=starwars;groups=rebels,empire");
    JcsFlushingModel expected = new JcsFlushingModel(new CacheStruct(
        "starwars", "rebels,empire"));
    assertEquals(expected, editor.getValue());
  }
View Full Code Here

    assertEquals(expected, editor.getValue());
  }

  public void testSetAsTextWithTextEndingWithDelimeter() {
    editor.setAsText("cacheName=main;groups=group1,group2|");
    JcsFlushingModel expected = new JcsFlushingModel(new CacheStruct("main",
        "group1,group2"));
    assertEquals(expected, editor.getValue());
  }
View Full Code Here

    try {
      int structCount = cacheStructs.length;

      for (int i = 0; i < structCount; i++) {
        CacheStruct cacheStruct = cacheStructs[i];
        if (cacheStruct == null) {
          continue;
        }

        String cacheName = cacheStruct.getCacheName();
        String[] groups = cacheStruct.getGroups();

        CompositeCache cache = getCache(cacheName);

        if (!ObjectUtils.isEmpty(groups)) {
          int groupCount = groups.length;
View Full Code Here

TOP

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

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.