Search in sources :

Example 1 with ResourceEntry

use of org.jboss.as.controller.registry.Resource.ResourceEntry in project wildfly by wildfly.

the class WSSubsystemAdd method readConfigServiceNames.

private static void readConfigServiceNames(List<ServiceName> serviceNames, Resource subsystemResource, String configType) {
    for (ResourceEntry re : subsystemResource.getChildren(configType)) {
        ServiceName configServiceName = Constants.CLIENT_CONFIG.equals(configType) ? PackageUtils.getClientConfigServiceName(re.getName()) : PackageUtils.getEndpointConfigServiceName(re.getName());
        serviceNames.add(configServiceName);
    }
}
Also used : ResourceEntry(org.jboss.as.controller.registry.Resource.ResourceEntry) ServiceName(org.jboss.msc.service.ServiceName)

Example 2 with ResourceEntry

use of org.jboss.as.controller.registry.Resource.ResourceEntry in project wildfly by wildfly.

the class RequiredChildValidationStepHandler method validateRequiredChild.

protected void validateRequiredChild(OperationContext context, ModelNode operation) throws OperationFailedException {
    Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS);
    PathAddress pathAddress = PathAddress.pathAddress(operation.get(OP_ADDR));
    Set<ResourceEntry> children = resource.getChildren(this.childElement.getName());
    if (children.isEmpty()) {
        throw ROOT_LOGGER.requiredChild(pathAddress.getLastElement().toString(), this.childElement.getName());
    }
}
Also used : ResourceEntry(org.jboss.as.controller.registry.Resource.ResourceEntry) PathAddress(org.jboss.as.controller.PathAddress) Resource(org.jboss.as.controller.registry.Resource)

Example 3 with ResourceEntry

use of org.jboss.as.controller.registry.Resource.ResourceEntry in project wildfly by wildfly.

the class PackageUtils method getServiceNameDependencies.

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);
    final ServiceName sn = baseServiceName.append(childType);
    for (ResourceEntry re : resource.getChildren(childType)) {
        childrenServiceNames.add(sn.append(re.getName()));
    }
    return childrenServiceNames;
}
Also used : ServiceName(org.jboss.msc.service.ServiceName) ResourceEntry(org.jboss.as.controller.registry.Resource.ResourceEntry) Resource(org.jboss.as.controller.registry.Resource) LinkedList(java.util.LinkedList)

Aggregations

ResourceEntry (org.jboss.as.controller.registry.Resource.ResourceEntry)3 Resource (org.jboss.as.controller.registry.Resource)2 ServiceName (org.jboss.msc.service.ServiceName)2 LinkedList (java.util.LinkedList)1 PathAddress (org.jboss.as.controller.PathAddress)1