/** * @param childType * @return * @see org.jboss.as.controller.registry.Resource#getChildrenNames(java.lang.String) */ public Set<String> getChildrenNames(String childType) { return delegate.getChildrenNames(childType); }
@Override public Set<String> getChildrenNames(String childType) { return delegate.getChildrenNames(childType); }
@Override public Set<String> getChildrenNames(String childType) { return delegate.getChildrenNames(childType); }
@Override public Set<String> getChildrenNames(final String childType) { if (BatchJobExecutionResourceDefinition.EXECUTION.equals(childType)) { synchronized (children) { refreshChildren(); return new LinkedHashSet<>(children); } } return delegate.getChildrenNames(childType); }
@Override public void transformResource(ResourceTransformationContext context, PathAddress address, Resource resource) throws OperationFailedException { for (String name : resource.getChildrenNames(ProtocolResourceDefinition.WILDCARD_PATH.getKey())) { resource.getModel().get(PROTOCOLS.getName()).add(name); } context.addTransformedResource(PathAddress.EMPTY_ADDRESS, resource).processChildren(resource); } };
@Override public Set<String> getChildrenNames(final String childType) { if (BALANCER.equals(childType)) { ModClusterService service = service(name); if(service == null) { return Collections.emptySet(); } ModCluster modCluster = service.getModCluster(); if(modCluster == null) { return Collections.emptySet(); } ModClusterController controller = modCluster.getController(); if(controller == null) { return Collections.emptySet(); } ModClusterStatus status = controller.getStatus(); final Set<String> result = new LinkedHashSet<>(); for (ModClusterStatus.LoadBalancer balancer : status.getLoadBalancers()) { result.add(balancer.getName()); } return result; } return delegate.getChildrenNames(childType); }
private static void checkThreadPool(final OperationContext context, final ModelNode operation, final String type) throws OperationFailedException { PathAddress threadPoolPath = context.getCurrentAddress(); PathAddress workManagerPath = threadPoolPath.getParent(); Set<String> entrySet = context.readResourceFromRoot(workManagerPath, false).getChildrenNames(type); if (entrySet.size() > 0 && !entrySet.iterator().next().equals(threadPoolPath.getLastElement().getValue())) { throw ConnectorLogger.ROOT_LOGGER.oneThreadPoolWorkManager(threadPoolPath.getLastElement().getValue(), type, workManagerPath.getLastElement().getValue()); } }
stackName = "*"; } else { Set<String> names = root.getChildrenNames("transport"); if (names.size() > 1) { throw new AssertionError("There should be at most one child");
final List<ServiceName> deps = new LinkedList<>(); for (String name : subsystemResource.getChildrenNames(CM_RESOURCE)) { deps.add(TxnServices.JBOSS_TXN_CMR.append(name));
@Override public void unregister(OperationContext context) { for (String name : context.readResource(PathAddress.EMPTY_ADDRESS).getChildrenNames(ProtocolResourceDefinition.WILDCARD_PATH.getKey())) { context.removeResource(PathAddress.pathAddress(ProtocolResourceDefinition.pathElement(name))); } context.getResourceRegistrationForUpdate().unregisterOverrideModel(context.getCurrentAddressValue()); }
Resource stackResource = context.readResourceFromRoot(stackAddress, false); for (String name: stackResource.getChildrenNames(TransportResourceDefinition.WILDCARD_PATH.getKey())) { PathAddress transportAddress = stackAddress.append(TransportResourceDefinition.pathElement(name)); ModelNode transport = context.readResourceFromRoot(transportAddress, false).getModel(); for (String name: stackResource.getChildrenNames(ProtocolResourceDefinition.WILDCARD_PATH.getKey())) { Resource protocolResource = context.readResourceFromRoot(stackAddress.append(ProtocolResourceDefinition.pathElement(name)), false); String moduleName = MODULE.resolveModelAttribute(context, protocolResource.getModel()).asString();
String requiredPathKey = requiredPath.getKey(); if (requiredPath.getKey().equals(path.getKey())) { Set<String> childrenNames = context.readResourceFromRoot(parentAddress, false).getChildrenNames(requiredPathKey); if (!childrenNames.isEmpty()) {
static List<ServiceName> getServiceNameDependencies(final OperationContext context, final ServiceName baseServiceName, final PathAddress address, final String childType) { final List<ServiceName> childrenServiceNames = new LinkedList<ServiceName>(); final Resource resource = context.readResourceFromRoot(address, false); final ServiceName sn = baseServiceName.append(childType); for (String name : resource.getChildrenNames(childType)) { childrenServiceNames.add(sn.append(name)); } return childrenServiceNames; } }
private String getExtension(OperationContext context, String subsystem) { for (String extensionName : context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS, false).getChildrenNames(EXTENSION)) { Resource extension = context.readResourceFromRoot(PathAddress.pathAddress(EXTENSION, extensionName), false); if (extension.getChildrenNames(SUBSYSTEM).contains(subsystem)) { return extensionName; } } return null; }
private static void readConfigServiceNames(List<ServiceName> serviceNames, Resource subsystemResource, String configType) { for (String name : subsystemResource.getChildrenNames(configType)) { ServiceName configServiceName = Constants.CLIENT_CONFIG.equals(configType) ? PackageUtils .getClientConfigServiceName(name) : PackageUtils.getEndpointConfigServiceName(name); serviceNames.add(configServiceName); } }
@Override public Set<String> getChildrenNames(String childType) { if (CORE_ADDRESS.equals(childType)) { return getCoreAddressNames(); } else if (RUNTIME_QUEUE.equals(childType)) { return getCoreQueueNames(); } else { return delegate.getChildrenNames(childType); } }
PathAddress getModelControllerResourceAddress(ManagementModel managementModel) { if (modelControllerResourceAddress == null) { Set<String> hosts = managementModel.getRootResource().getChildrenNames(HOST); // if we don't actually have a host name yet (e.g. --empty-host-config) we return null for now. if (hosts.size() == 0) { return null; } String hostName = hosts.iterator().next(); modelControllerResourceAddress = PathAddress.pathAddress(HOST, hostName).append(MODEL_CONTROLLER_ADDRESS); } return modelControllerResourceAddress; }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { final Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS); Set<String> children = resource.getChildrenNames(ModelDescriptionConstants.CACHE); if (children.size() > 1) { String realmName = ManagementUtil.getSecurityRealmName(operation); throw DomainManagementLogger.ROOT_LOGGER.multipleCacheConfigurationsDefined(realmName); } } }
private static void checkThreadPool(final OperationContext context, final ModelNode operation, final String type) throws OperationFailedException { PathAddress threadPoolPath = context.getCurrentAddress(); PathAddress workManagerPath = threadPoolPath.getParent(); Set<String> entrySet = context.readResourceFromRoot(workManagerPath, false).getChildrenNames(type); if (entrySet.size() > 0 && !entrySet.iterator().next().equals(threadPoolPath.getLastElement().getValue())) { throw ConnectorLogger.ROOT_LOGGER.oneThreadPoolWorkManager(threadPoolPath.getLastElement().getValue(), type, workManagerPath.getLastElement().getValue()); } }
protected void validateOccurrence(OperationContext context, ModelNode operation) throws OperationFailedException { PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR)); PathAddress parentAddress = Util.getParentAddressByKey(address, this.parentElement.getName()); Set<String> elements = context.readResourceFromRoot(parentAddress, false).getChildrenNames(this.element.getName()); if (elements.size() > this.maxOccurs) { throw ROOT_LOGGER.invalidChildTypeOccurrence(parentAddress.getLastElement().toString(), this.maxOccurs, this.element .getName()); } } }