本文整理汇总了Java中org.jboss.as.controller.registry.Resource.hasChildren方法的典型用法代码示例。如果您正苦于以下问题:Java Resource.hasChildren方法的具体用法?Java Resource.hasChildren怎么用?Java Resource.hasChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.as.controller.registry.Resource
的用法示例。
在下文中一共展示了Resource.hasChildren方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doIterate
import org.jboss.as.controller.registry.Resource; //导入方法依赖的package包/类
private void doIterate(final Resource current, final PathAddress address) {
boolean handleChildren = false;
ObjectName resourceObjectName = action.onAddress(address);
if (resourceObjectName != null &&
(accessControlUtil == null || accessControlUtil.getResourceAccess(address, false).isAccessibleResource())) {
handleChildren = action.onResource(resourceObjectName);
}
if (handleChildren) {
for (String type : current.getChildTypes()) {
if (current.hasChildren(type)) {
for (ResourceEntry entry : current.getChildren(type)) {
final PathElement pathElement = entry.getPathElement();
final PathAddress childAddress = address.append(pathElement);
doIterate(entry, childAddress);
}
}
}
}
}
示例2: listDeploymentNames
import org.jboss.as.controller.registry.Resource; //导入方法依赖的package包/类
private static Set<String> listDeploymentNames(Resource deploymentRootResource, Set<Pattern> patterns) {
Set<String> deploymentNames = new HashSet<>();
if (deploymentRootResource.hasChildren(DEPLOYMENT)) {
for (Resource.ResourceEntry deploymentResource : deploymentRootResource.getChildren(DEPLOYMENT)) {
if (isAcceptableDeployment(deploymentResource.getModel(), patterns)) {
deploymentNames.add(deploymentResource.getName());
} else if (deploymentResource.hasChildren(SUBDEPLOYMENT)) {
for (Resource.ResourceEntry subdeploymentResource : deploymentResource.getChildren(SUBDEPLOYMENT)) {
if (isAcceptableDeployment(subdeploymentResource.getModel(), patterns)) {
deploymentNames.add(deploymentResource.getName());
}
}
}
}
}
return deploymentNames;
}
示例3: listLinks
import org.jboss.as.controller.registry.Resource; //导入方法依赖的package包/类
/**
* Returns all the deployment runtime names associated with an overlay.
*
* @param context the current OperationContext.
* @param overlayAddress the address for the averlay.
* @return all the deployment runtime names associated with an overlay.
*/
public static Set<String> listLinks(OperationContext context, PathAddress overlayAddress) {
Resource overlayResource = context.readResourceFromRoot(overlayAddress);
if (overlayResource.hasChildren(DEPLOYMENT)) {
return overlayResource.getChildrenNames(DEPLOYMENT);
}
return Collections.emptySet();
}
示例4: listServerGroupsReferencingOverlay
import org.jboss.as.controller.registry.Resource; //导入方法依赖的package包/类
private static Set<String> listServerGroupsReferencingOverlay(Resource rootResource, String overlayName) {
final PathElement overlayPath = PathElement.pathElement(DEPLOYMENT_OVERLAY, overlayName);
if (rootResource.hasChildren(SERVER_GROUP)) {
Set<String> set = new HashSet<>();
for (String serverGroupName : rootResource.getChildrenNames(SERVER_GROUP)) {
if (rootResource.getChild(PathElement.pathElement(SERVER_GROUP, serverGroupName)).hasChild(overlayPath)) {
set.add(serverGroupName);
}
}
return set;
}
return Collections.emptySet();
}