当前位置: 首页>>代码示例>>Java>>正文


Java Resource.getOrderedChildTypes方法代码示例

本文整理汇总了Java中org.jboss.as.controller.registry.Resource.getOrderedChildTypes方法的典型用法代码示例。如果您正苦于以下问题:Java Resource.getOrderedChildTypes方法的具体用法?Java Resource.getOrderedChildTypes怎么用?Java Resource.getOrderedChildTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jboss.as.controller.registry.Resource的用法示例。


在下文中一共展示了Resource.getOrderedChildTypes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: describe

import org.jboss.as.controller.registry.Resource; //导入方法依赖的package包/类
private void describe(final PathAddress base, final Resource resource, List<ModelNode> nodes, boolean isRuntimeChange) {
    if (resource.isProxy() || resource.isRuntime()) {
        return; // ignore runtime and proxies
    } else if (base.size() >= 1 && base.getElement(0).getKey().equals(ModelDescriptionConstants.HOST)) {
        return; // ignore hosts
    }
    if (base.size() == 1) {
        newRootResources.add(base.getLastElement());
    }
    final ModelNode description = new ModelNode();
    description.get(DOMAIN_RESOURCE_ADDRESS).set(base.toModelNode());
    description.get(DOMAIN_RESOURCE_MODEL).set(resource.getModel());
    Set<String> orderedChildren = resource.getOrderedChildTypes();
    if (orderedChildren.size() > 0) {
        ModelNode orderedChildTypes = description.get(DOMAIN_RESOURCE_PROPERTIES, ORDERED_CHILD_TYPES_PROPERTY);
        for (String type : orderedChildren) {
            orderedChildTypes.add(type);
        }
    }
    nodes.add(description);
    for (final String childType : resource.getChildTypes()) {
        for (final Resource.ResourceEntry entry : resource.getChildren(childType)) {
            describe(base.append(entry.getPathElement()), entry, nodes, isRuntimeChange);
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:27,代码来源:ReadMasterDomainModelUtil.java

示例2: addTransformedRecursiveResourceFromRoot

import org.jboss.as.controller.registry.Resource; //导入方法依赖的package包/类
private ResourceTransformationContext addTransformedRecursiveResourceFromRoot(final PathAddress absoluteAddress, final PathAddress read, final Resource toAdd) {
    Resource model = this.root;
    Resource parent = null;
    if (absoluteAddress.size() > 0) {
        final Iterator<PathElement> i = absoluteAddress.iterator();
        while (i.hasNext()) {
            final PathElement element = i.next();
            if (element.isMultiTarget()) {
                throw ControllerLogger.ROOT_LOGGER.cannotWriteTo("*");
            }
            if (!i.hasNext()) {
                if (model.hasChild(element)) {
                    throw ControllerLogger.ROOT_LOGGER.duplicateResourceAddress(absoluteAddress);
                } else {
                    parent = model;
                    model.registerChild(element, toAdd);
                    model = toAdd;
                    if (read.size() > 0) {
                        //We might be able to deal with this better in the future, but for now
                        //throw an error if the address was renamed and it was an ordered child type.
                        Set<String> parentOrderedChildren = parent.getOrderedChildTypes();
                        String readType = read.getLastElement().getKey();
                        if (parentOrderedChildren.contains(readType)) {
                            if (absoluteAddress.size() == 0 || !absoluteAddress.getLastElement().getKey().equals(readType)) {
                                throw ControllerLogger.ROOT_LOGGER.orderedChildTypeRenamed(read, absoluteAddress, readType, parentOrderedChildren);
                            }
                        }
                    }
                }
            } else {
                model = model.getChild(element);
                if (model == null) {
                    PathAddress ancestor = PathAddress.EMPTY_ADDRESS;
                    for (PathElement pe : absoluteAddress) {
                        ancestor = ancestor.append(pe);
                        if (element.equals(pe)) {
                            break;
                        }
                    }
                    throw ControllerLogger.ROOT_LOGGER.resourceNotFound(ancestor, absoluteAddress);
                }
            }
        }
    } else {
        //If this was the root address, replace the resource model
        model.writeModel(toAdd.getModel());
    }
    return new ResourceTransformationContextImpl(root, absoluteAddress, read, originalModel,
            transformerOperationAttachment, ignoredTransformationRegistry);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:51,代码来源:ResourceTransformationContextImpl.java

示例3: addOrderedChildResourceTypes

import org.jboss.as.controller.registry.Resource; //导入方法依赖的package包/类
/**
 * If the resource has ordered child types, those child types will be stored in the attachment. If there are no
 * ordered child types, this method is a no-op.
 *
 * @param resourceAddress the address of the resource
 * @param resource the resource which may or may not have ordered children.
 */
public void addOrderedChildResourceTypes(PathAddress resourceAddress, Resource resource) {
    Set<String> orderedChildTypes = resource.getOrderedChildTypes();
    if (orderedChildTypes.size() > 0) {
        orderedChildren.put(resourceAddress, resource.getOrderedChildTypes());
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:14,代码来源:OrderedChildTypesAttachment.java


注:本文中的org.jboss.as.controller.registry.Resource.getOrderedChildTypes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。