Package com.dotcms.repackage.org.jboss.cache

Examples of com.dotcms.repackage.org.jboss.cache.Node


   * @see com.dotmarketing.business.DotCacheAdministrator#flushGroup(java.lang.String)
   */
  public void flushGroup(String group) {
    //cache.removeNode(group);
    group = group.toUpperCase();
    Node groupNode =cache.getRoot().getChild(group);
    if(groupNode != null){
      flushGroupLocalOnly(group);
    }
    try{
      if(Config.getBooleanProperty("CACHE_CLUSTER_THROUGH_DB", false)){
View Full Code Here


    regions.clear();
  }
 
  public void flushGroupLocalOnly(String group) {
    group = group.toUpperCase();
    Node grp = cache.getRoot().getChild(group);
    if(grp == null){
      setUpGroup(group);
      cache.getRoot().getChild(group);
    }
    cache.removeNode(grp.getFqn());
    setUpGroup(group);
  }
View Full Code Here

    setUpGroup(group);
    cache.put(fqn, key, content);
  }

  private void setUpGroup(String group){
    Node test = regions.get(group);
    Node grp = cache.getRoot().getChild(group);
    if (grp == null || test == null || !grp.isResident() || !grp.equals(test)) { //TEST THIS LINE
      synchronized (group) {
        if(grp == null){
          Fqn fqn = Fqn.fromString(group);
//          cache.getRegion(fqn, true);
//          grp = cache.getNode(fqn);
          grp = cache.getRoot().addChild(fqn);
          grp.getChildren();
        }
        if (grp != null || !grp.isResident() || !grp.equals(test)) {
          grp.setResident(true);
          regions.put(group, grp);
        }
      }
    }
  }
View Full Code Here

    cache.remove(fqn, key);
  }

  public Set<String> getKeys(String group) {
    group = group.toUpperCase();
    Node n= cache.getNode(Fqn.fromString(group));
    Set<String> result = new HashSet<String>();
   
    if (n!=null) {
      Set<Object> s =  n.getChildrenNames();
      for (Object o : s) {
        String r = o.toString();
        if (r.startsWith(group)) {
          result.add(r.substring(group.length(), r.length()));
        } else {
View Full Code Here

    return result;
  }
 
  public long getSize(String group){
    try{
      Node n = cache.getNode(group);
      return n.getChildren().size();
    }catch (Exception e) {
      return 0;
    }
  }
View Full Code Here

   
    for (Object group : s2) {
      Map<String, Object> m = new HashMap<String, Object>();
      m.put("region", group.toString());
      try{
        Node n = cache.getNode(group.toString());
        m.put("resident", n.isResident());
        m.put("memory", n.getChildren().size());
        try{
          m.put("evictionQueueCapacity", cache.getRegion(n.getFqn(),false).getEvictionRegionConfig().getEventQueueSize());
          m.put("evictionAlgorithm", cache.getRegion(n.getFqn(),false).getEvictionRegionConfig().getEvictionAlgorithmConfig());
        }catch (Exception e) {
          m.put("evictionQueueCapacity", "");
          m.put("evictionAlgorithm", "");
        }
        try{
          m.put("evictionQueueSize", ((com.dotcms.repackage.org.jboss.cache.RegionImpl)cache.getRegion(n.getFqn(),false)).getEvictionEventQueue().size());
        }catch (NullPointerException e) {
          m.put("evictionQueueSize", -1);
        }
      }catch (Exception e) {
        // do nothing
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.org.jboss.cache.Node

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.