Search in sources :

Example 1 with FrameworkInfo

use of org.apache.karaf.features.internal.service.BundleInstallSupport.FrameworkInfo in project karaf by apache.

the class FeaturesServiceImpl method getDeploymentState.

private Deployer.DeploymentState getDeploymentState(State state) throws Exception {
    Deployer.DeploymentState dstate = new Deployer.DeploymentState();
    dstate.state = state;
    FrameworkInfo info = installSupport.getInfo();
    dstate.serviceBundle = info.ourBundle;
    dstate.initialBundleStartLevel = info.initialBundleStartLevel;
    dstate.currentStartLevel = info.currentStartLevel;
    dstate.bundles = info.bundles;
    // Features
    dstate.features = new HashMap<>();
    for (Map<String, Feature> m : getFeatures().values()) {
        for (Feature feature : m.values()) {
            String id = feature.getId();
            dstate.features.put(id, feature);
        }
    }
    RegionDigraph regionDigraph = installSupport.getDiGraphCopy();
    dstate.bundlesPerRegion = DigraphHelper.getBundlesPerRegion(regionDigraph);
    dstate.filtersPerRegion = DigraphHelper.getPolicies(regionDigraph);
    return dstate;
}
Also used : RegionDigraph(org.eclipse.equinox.region.RegionDigraph) FrameworkInfo(org.apache.karaf.features.internal.service.BundleInstallSupport.FrameworkInfo) Feature(org.apache.karaf.features.Feature)

Example 2 with FrameworkInfo

use of org.apache.karaf.features.internal.service.BundleInstallSupport.FrameworkInfo in project karaf by apache.

the class FeaturesServiceImplTest method createTestFeatureService.

private FeaturesServiceImpl createTestFeatureService() {
    FeaturesServiceConfig cfg = new FeaturesServiceConfig();
    BundleInstallSupport installSupport = EasyMock.niceMock(BundleInstallSupport.class);
    FrameworkInfo dummyInfo = new FrameworkInfo();
    expect(installSupport.getInfo()).andReturn(dummyInfo).atLeastOnce();
    EasyMock.replay(installSupport);
    final FeaturesServiceImpl featureService = new FeaturesServiceImpl(new Storage(), null, null, this.resolver, installSupport, null, cfg);
    return featureService;
}
Also used : FrameworkInfo(org.apache.karaf.features.internal.service.BundleInstallSupport.FrameworkInfo)

Example 3 with FrameworkInfo

use of org.apache.karaf.features.internal.service.BundleInstallSupport.FrameworkInfo in project karaf by apache.

the class FeaturesServiceTest method dummyInfo.

private FrameworkInfo dummyInfo() {
    FrameworkInfo info = new FrameworkInfo();
    info.initialBundleStartLevel = 50;
    info.currentStartLevel = 100;
    return info;
}
Also used : FrameworkInfo(org.apache.karaf.features.internal.service.BundleInstallSupport.FrameworkInfo)

Aggregations

FrameworkInfo (org.apache.karaf.features.internal.service.BundleInstallSupport.FrameworkInfo)3 Feature (org.apache.karaf.features.Feature)1 RegionDigraph (org.eclipse.equinox.region.RegionDigraph)1