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


Java Resource.requireChild方法代码示例

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


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

示例1: testAddSocketBinding

import org.jboss.as.controller.registry.Resource; //导入方法依赖的package包/类
@Test
public void testAddSocketBinding() throws Exception {
    Resource root = rootResource.clone();
    Resource socketBinding = Resource.Factory.create();
    socketBinding.getModel().get(PORT).set(1000);
    Resource socketBindingGroup = root.requireChild(PathElement.pathElement(SOCKET_BINDING_GROUP, "binding-one"));
    socketBindingGroup.registerChild(PathElement.pathElement(SOCKET_BINDING, "testing"), socketBinding);

    executeTriggerSyncOperation(root);
    Assert.assertEquals(RELOAD_REQUIRED, serverProxies.get("server-one").state);
    Assert.assertEquals(RELOAD_REQUIRED, serverProxies.get("server-two").state);
    Assert.assertEquals("running", serverProxies.get("server-three").state);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:14,代码来源:SyncModelServerStateTestCase.java

示例2: registerServerGroupDeploymentOverlay

import org.jboss.as.controller.registry.Resource; //导入方法依赖的package包/类
private void registerServerGroupDeploymentOverlay(Resource root, String groupName, String overlayName, String deploymentName) {
    Resource group = root.requireChild(PathElement.pathElement(SERVER_GROUP, groupName));
    Resource overlay = Resource.Factory.create();
    group.registerChild(PathElement.pathElement(DEPLOYMENT_OVERLAY, overlayName), overlay);
    Resource deployment = Resource.Factory.create();
    deployment.getModel().setEmptyObject();
    overlay.registerChild(PathElement.pathElement(DEPLOYMENT, deploymentName), deployment);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:9,代码来源:SyncModelServerStateTestCase.java

示例3: registerServerGroupDeployment

import org.jboss.as.controller.registry.Resource; //导入方法依赖的package包/类
private void registerServerGroupDeployment(Resource root, String groupName, String deploymentName) {
    Resource group = root.requireChild(PathElement.pathElement(SERVER_GROUP, groupName));
    Resource deployment = Resource.Factory.create();
    deployment.getModel().get(ENABLED).set(true);
    deployment.getModel().get(RUNTIME_NAME).set(deploymentName);
    group.registerChild(PathElement.pathElement(DEPLOYMENT, deploymentName), deployment);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:8,代码来源:SyncModelServerStateTestCase.java

示例4: readResourceFromRoot

import org.jboss.as.controller.registry.Resource; //导入方法依赖的package包/类
@Override
public Resource readResourceFromRoot(PathAddress address, boolean recursive) {
    Resource resource = this.root;
    if (recursive) {
        for (PathElement element : address) {
            resource = resource.requireChild(element);
        }
    }
    return resource;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:11,代码来源:AbstractOperationTestCase.java

示例5: requireChild

import org.jboss.as.controller.registry.Resource; //导入方法依赖的package包/类
private static Resource requireChild(final Resource resource, final PathElement childPath, final PathAddress fullAddress) {
    if (resource.hasChild(childPath)) {
        return resource.requireChild(childPath);
    } else {
        PathAddress missing = PathAddress.EMPTY_ADDRESS;
        for (PathElement search : fullAddress) {
            missing = missing.append(search);
            if (search.equals(childPath)) {
                break;
            }
        }
        throw ControllerLogger.ROOT_LOGGER.managementResourceNotFound(missing);
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:15,代码来源:OperationContextImpl.java

示例6: getOrCreate

import org.jboss.as.controller.registry.Resource; //导入方法依赖的package包/类
private static Resource getOrCreate(final Resource parent, final PathElement element, final Resource desired) {
    synchronized (parent) {
        if (parent.hasChild(element)) {
            if (desired == null) {
                return parent.requireChild(element);
            } else {
                throw new IllegalStateException();
            }
        } else {
            return register(parent, element, desired);
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:14,代码来源:DeploymentResourceSupport.java

示例7: findSubsystemResource

import org.jboss.as.controller.registry.Resource; //导入方法依赖的package包/类
Resource findSubsystemResource(Resource rootResource) {
    Resource subsystem = rootResource.requireChild(PROFILE_ELEMENT);
    return subsystem.requireChild(SUBSYSTEM_ELEMENT);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:5,代码来源:AbstractOrderedChildResourceSyncModelTestCase.java


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