本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
}
示例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);
}
}
}
示例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);
}