Package org.apache.jcs.engine.control.group

Examples of org.apache.jcs.engine.control.group.GroupId


    KeyAndModel keyAndModel = getKeyAndModel(keyAndModelIndex);
    JcsCachingModel model = (JcsCachingModel) keyAndModel.model;

    String cacheName = model.getCacheName();
    CompositeCache cache = cacheManager.getCache(cacheName);
    GroupId groupId = new GroupId(cacheName, model.getGroup());
    GroupAttrName groupAttrName = new GroupAttrName(groupId, keyAndModel.key);
    return cache.get(groupAttrName);
  }
View Full Code Here


  }

  public void testGetKeyWithGroupName() {
    cachingModel.setGroup("empire");
    Serializable key = "Vader";
    GroupId groupId = new GroupId(CACHE_NAME, cachingModel.getGroup());
    GroupAttrName expected = new GroupAttrName(groupId, key);
    Serializable actual = jcsFacade.getKey(key, cachingModel);
    assertEquals(expected, actual);
  }
View Full Code Here

  private Serializable updateCache(CacheEntry cacheEntry) throws Exception {
    Serializable key = cacheEntry.key;
    String group = cacheEntry.group;

    if (StringUtils.hasText(group)) {
      GroupId groupId = new GroupId(CACHE_NAME, group);
      GroupAttrName groupAttrName = new GroupAttrName(groupId, key);
      key = groupAttrName;
    }

    ICacheElement cacheElement = new CacheElement(CACHE_NAME, key,
View Full Code Here

  protected Serializable getKey(Serializable key, JcsCachingModel model) {
    Serializable newKey = key;

    String group = model.getGroup();
    if (StringUtils.hasText(group)) {
      GroupId groupId = new GroupId(model.getCacheName(), group);
      newKey = new GroupAttrName(groupId, key);
    }

    return newKey;
  }
View Full Code Here

        CompositeCache cache = getCache(cacheName);

        if (!ObjectUtils.isEmpty(groups)) {
          int groupCount = groups.length;
          for (int j = 0; j < groupCount; j++) {
            GroupId groupId = new GroupId(cacheName, groups[j]);
            cache.remove(groupId);
          }
        } else {
          cache.removeAll();
        }
View Full Code Here

        return this.cache;
    }

    public Set getGroupKeys(String groupName)
    {
        GroupId groupId = new GroupId(getCacheName(), groupName);
        HashSet keys = new HashSet();
        synchronized ( map )
        {
            for (Iterator itr = map.entrySet().iterator(); itr.hasNext();)
            {
View Full Code Here

        return object;
    }

    public Set getGroupKeys(String groupName)
    {
        GroupId groupId = new GroupId(cacheName, groupName);
        HashSet keys = new HashSet();
        try
        {
            storageLock.readLock();
View Full Code Here

        return ( element != null ) ? element.getVal() : null;
    }

    private GroupAttrName getGroupAttrName(String group, Object name)
    {
        GroupId gid = new GroupId(cacheControl.getCacheName(), group);
        return new GroupAttrName(gid, name);
    }
View Full Code Here


    /** Invalidates a group */
    public void invalidateGroup( String group )
    {
        cacheControl.remove(new GroupId( cacheControl.getCacheName(), group ));
    }
View Full Code Here

     * @param name
     * @return GroupAttrName
     */
    private GroupAttrName getGroupAttrName( String group, Object name )
    {
        GroupId gid = new GroupId( this.cacheControl.getCacheName(), group );
        return new GroupAttrName( gid, name );
    }
View Full Code Here

TOP

Related Classes of org.apache.jcs.engine.control.group.GroupId

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.