use of org.apache.karaf.features.management.codec.JmxFeature in project karaf by apache.
the class FeaturesServiceMBeanImpl method getFeatures.
/**
* {@inheritDoc}
*/
public TabularData getFeatures() throws Exception {
try {
List<Feature> allFeatures = Arrays.asList(featuresService.listFeatures());
List<Feature> insFeatures = Arrays.asList(featuresService.listInstalledFeatures());
ArrayList<JmxFeature> features = new ArrayList<>();
for (Feature feature : allFeatures) {
try {
features.add(new JmxFeature(feature, insFeatures.contains(feature)));
} catch (Throwable t) {
t.printStackTrace();
}
}
return JmxFeature.tableFrom(features);
} catch (Throwable t) {
t.printStackTrace();
return null;
}
}
use of org.apache.karaf.features.management.codec.JmxFeature in project karaf by apache.
the class FeaturesServiceMBeanImpl method infoFeature.
private TabularData infoFeature(Feature[] f) throws Exception {
ArrayList<JmxFeature> features = new ArrayList<>();
for (Feature feature : f) {
JmxFeature jmxFeature;
if (featuresService.isInstalled(feature)) {
jmxFeature = new JmxFeature(feature, true);
} else {
jmxFeature = new JmxFeature(feature, false);
}
features.add(jmxFeature);
}
return JmxFeature.tableFrom(features);
}
Aggregations