void execute(final PathAddress address, final PathAddress base, final OperationContext context) {
final Resource resource = context.readResource(base);
final PathAddress current = address.subAddress(base.size());
final Iterator<PathElement> iterator = current.iterator();
if(iterator.hasNext()) {
final PathElement element = iterator.next();
if(element.isMultiTarget()) {
final String childType = element.getKey().equals("*") ? null : element.getKey();
final ImmutableManagementResourceRegistration registration = context.getResourceRegistration().getSubModel(base);
if(registration.isRemote() || registration.isRuntimeOnly()) {
// At least for proxies it should use the proxy operation handler
throw new IllegalStateException();
}
final Map<String, Set<String>> resolved = getChildAddresses(registration, resource, childType);
for (Map.Entry<String, Set<String>> entry : resolved.entrySet()) {
final String key = entry.getKey();
final Set<String> children = entry.getValue();
if(children.isEmpty()) {
continue;
}
if(element.isWildcard()) {
for(final String child : children) {
// Double check if the child actually exists
if(resource.hasChild(PathElement.pathElement(key, child))) {
execute(address, base.append(PathElement.pathElement(key, child)), context);
}
}
} else {
for(final String segment : element.getSegments()) {
if(children.contains(segment)) {
// Double check if the child actually exists
if(resource.hasChild(PathElement.pathElement(key, segment))) {
execute(address, base.append(PathElement.pathElement(key, segment)), context);
}