use of io.fabric8.api.commands.JMXRequest in project fabric8 by jboss-fuse.
the class JMXCommandActionSupport method doExecute.
@Override
protected Object doExecute() throws Exception {
Collection<String> names = new LinkedList<>();
if (allContainers) {
if (containers != null && containers.size() > 0) {
System.out.println("Container names are ignored when using \"--all\" option.");
}
Container[] all = CommandUtils.sortContainers(fabricService.getContainers());
for (Container c : all) {
names.add(c.getId());
}
} else {
names.addAll(ContainerGlobSupport.expandGlobNames(fabricService, containers));
}
List<String> validContainerNames = new LinkedList<>();
for (String name : names) {
try {
validateContainerName(name);
} catch (IllegalArgumentException e) {
System.err.println("Skipping illegal container name \"" + name + "\"");
continue;
}
validContainerNames.add(name);
}
beforeEachContainer(validContainerNames);
for (String name : validContainerNames) {
// for each container we have to pass JMXRequest
String path = ZkPath.COMMANDS_REQUESTS_QUEUE.getPath(name);
performContainerAction(path, name);
}
afterEachContainer(validContainerNames);
cleanResponses();
return null;
}
Aggregations