Search in sources :

Example 1 with JmxFeature

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;
    }
}
Also used : JmxFeature(org.apache.karaf.features.management.codec.JmxFeature) Feature(org.apache.karaf.features.Feature) JmxFeature(org.apache.karaf.features.management.codec.JmxFeature)

Example 2 with JmxFeature

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);
}
Also used : JmxFeature(org.apache.karaf.features.management.codec.JmxFeature) Feature(org.apache.karaf.features.Feature) JmxFeature(org.apache.karaf.features.management.codec.JmxFeature)

Aggregations

Feature (org.apache.karaf.features.Feature)2 JmxFeature (org.apache.karaf.features.management.codec.JmxFeature)2