org.jboss.cache.Node.getChildrenNames()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(99)

本文整理了Java中org.jboss.cache.Node.getChildrenNames()方法的一些代码示例,展示了Node.getChildrenNames()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getChildrenNames()方法的具体详情如下:
包路径:org.jboss.cache.Node
类名称:Node
方法名:getChildrenNames

Node.getChildrenNames介绍

[英]Returns an immutable set of children node names.
[中]返回一组不可变的子节点名称。

代码示例

代码示例来源:origin: org.jboss.cache/jbosscache-core

@Override
public boolean isEmpty()
{
  return node.getChildrenNames().isEmpty();
}

代码示例来源:origin: org.jboss.cache/jbosscache-core

@Override
public int size()
{
  return node.getChildrenNames().size();
}

代码示例来源:origin: org.jboss.cache/jbosscache-core

@Override
public void clear()
{
  for (Object o : node.getChildrenNames())
   node.removeChild(o);
}

代码示例来源:origin: org.jboss.cache/jbosscache-core

public Set<?> getChildrenNames(Fqn fqn) throws Exception
{
 Node node = delegate.getRoot().getChild(fqn);
 if (node == null) return null;
 Set cn = node.getChildrenNames();
 // the cache loader contract is a bit different from the cache when it comes to dealing with childrenNames
 if (cn.isEmpty()) return null;
 return cn;
}

代码示例来源:origin: org.hibernate/hibernate-jbosscache2

public static Set getChildrenNames(Cache cache, Fqn fqn) {
  Node node = cache.getRoot().getChild(fqn);
  return (node != null) ? node.getChildrenNames() : Collections.emptySet();
}

代码示例来源:origin: org.hibernate/hibernate-jbosscache

public static Set getChildrenNames(Cache cache, Fqn fqn) {
  Node node = cache.getRoot().getChild(fqn);
  return (node != null) ? node.getChildrenNames() : Collections.emptySet();
}

代码示例来源:origin: org.jboss.cache/jbosscache-core

fqn = (Fqn) input.readObject();
Node node = c.getRoot().getChild(fqn);
Set<Object> children = node == null ? Collections.emptySet() : new HashSet(node.getChildrenNames());
output.writeObject(children);
break;

代码示例来源:origin: org.mobicents.servlet.sip.containers/sip-servlets-jboss5-ha-server-cache

public Map<String, String> getSipSessionKeys() {
  Map<String, String> result = new HashMap<String, String>();
  Fqn<String> sipappFqn = getSipappFqn();
  Node<Object, Object> bbRoot = jBossCacheService.getCache().getRoot()
      .getChild(jBossCacheService.BUDDY_BACKUP_FQN);
  if (bbRoot != null) {
    Set<Node<Object, Object>> owners = bbRoot.getChildren();
    if (owners != null) {
      for (Node<Object, Object> owner : owners) {
        @SuppressWarnings("unchecked")
        Node sipRoot = owner.getChild(sipappFqn);
        if (sipRoot != null) {
          @SuppressWarnings("unchecked")
          Set<String> ids = sipRoot.getChildrenNames();
          storeSipSessionOwners(ids, (String) owner.getFqn()
              .getLastElement(), result);
        }
      }
    }
  }
  storeSipSessionOwners(jBossCacheService.getChildrenNames(sipappFqn), null,
      result);
  return result;
}

代码示例来源:origin: org.mobicents.servlet.sip.containers/sip-servlets-jboss5-ha-server-cache

public Map<String, String> getSipApplicationSessionKeys() {
  Map<String, String> result = new HashMap<String, String>();
  Fqn<String> sipappFqn = getSipappFqn();
  Node<Object, Object> bbRoot = jBossCacheService.getCache().getRoot()
      .getChild(jBossCacheService.BUDDY_BACKUP_FQN);
  if (bbRoot != null) {
    Set<Node<Object, Object>> owners = bbRoot.getChildren();
    if (owners != null) {
      for (Node<Object, Object> owner : owners) {
        @SuppressWarnings("unchecked")
        Node sipRoot = owner.getChild(sipappFqn);
        if (sipRoot != null) {
          @SuppressWarnings("unchecked")
          Set<String> ids = sipRoot.getChildrenNames();
          storeSipApplicationSessionOwners(ids, (String) owner.getFqn()
              .getLastElement(), result);
        }
      }
    }
  }
  storeSipApplicationSessionOwners(jBossCacheService.getChildrenNames(sipappFqn), null,
      result);
  return result;
}

代码示例来源:origin: org.jboss.cache/jbosscache-core

private Fqn getDefunctBackupRootFqn(Address dataOwner)
{
 // the defunct Fqn should be: /_BUDDY_BACKUP_/dataOwnerAddess:DEAD/N
 // where N is a number.
 Fqn defunctRoot = buddyFqnTransformer.getDeadBackupRoot(dataOwner);
 cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
 cache.getInvocationContext().getOptionOverrides().setSkipCacheStatusCheck(true);
 Node<?, ?> root = cache.getRoot();
 cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
 cache.getInvocationContext().getOptionOverrides().setSkipCacheStatusCheck(true);
 Node<?, ?> defunctRootNode = root.addChild(defunctRoot);
 SortedSet<Object> childrenNames = new TreeSet<Object>(defunctRootNode.getChildrenNames()); // will be naturally sorted.
 Integer childName = 1;
 if (!childrenNames.isEmpty())
 {
   Integer lastChild = (Integer) childrenNames.last();
   childName = lastChild + 1;
 }
 cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
 defunctRootNode.addChild(Fqn.fromElements(childName));
 return Fqn.fromRelativeElements(defunctRoot, childName);
}

代码示例来源:origin: org.jboss.cache/jbosscache-core

actualNode.getChildrenNames();

相关文章