Package org.apache.karaf.features

Examples of org.apache.karaf.features.BundleInfo


        if (state.installed.contains(bundle)
                || (bundle.getState() != Bundle.STARTING && bundle.getState() != Bundle.ACTIVE
                        && bundle.adapt(BundleStartLevel.class).isPersistentlyStarted())) {
          // do no start bundles when user request it
          Long bundleId = bundle.getBundleId();
          BundleInfo bundleInfo = state.bundleInfos.get(bundleId);
            if (bundleInfo == null || bundleInfo.isStart()) {
                try {
                    bundle.start();
                } catch (BundleException be) {
                    String msg = format("Could not start bundle %s in feature(s) %s: %s", bundle.getLocation(), getFeaturesContainingBundleList(bundle), be.getMessage());
                    throw new Exception(msg, be);
View Full Code Here


                    if (state.installed.contains(b)
                            || (b.getState() != Bundle.STARTING && b.getState() != Bundle.ACTIVE
                                    && getStartLevel().isBundlePersistentlyStarted(b))) {
                      // do no start bundles when user request it
                      Long bundleId = b.getBundleId();
                      BundleInfo bundleInfo = state.bundleInfos.get(bundleId);
                        if (bundleInfo == null || bundleInfo.isStart()) {
                          try {
                              b.start();
                          } catch (BundleException be) {
                              String msg = format("Could not start bundle %s in feature(s) %s: %s", b.getLocation(), getFeaturesContainingBundleList(b), be.getMessage());
                              throw new Exception(msg, be);
View Full Code Here

            throw new Exception("Can not resolve feature:\n" + w.toString());
        }

        List<BundleInfo> bundles = new ArrayList<BundleInfo>();
        for (Resource res : resolver.getRequiredResources()) {
            BundleInfo info = infos.get(res);
            if (info == null) {
                Reason[] reasons = resolver.getReason(res);
                if (reasons != null) {
                    for (Reason r : reasons) {
                        info = infos.get(r);
View Full Code Here

                    if (state.installed.contains(b)
                            || (b.getState() != Bundle.STARTING && b.getState() != Bundle.ACTIVE
                            && getStartLevel().isBundlePersistentlyStarted(b))) {
                        // do no start bundles when user request it
                        Long bundleId = b.getBundleId();
                        BundleInfo bundleInfo = state.bundleInfos.get(bundleId);
                        if (bundleInfo == null || bundleInfo.isStart()) {
                            try {
                                b.start();
                            } catch (BundleException be) {
                                String msg = format("Could not start bundle %s in feature(s) %s: %s", b.getLocation(), getFeaturesContainingBundleList(b), be.getMessage());
                                throw new Exception(msg, be);
View Full Code Here

                    if (state.installed.contains(b)
                            || (b.getState() != Bundle.STARTING && b.getState() != Bundle.ACTIVE
                            && getStartLevel().isBundlePersistentlyStarted(b))) {
                        // do no start bundles when user request it
                        Long bundleId = b.getBundleId();
                        BundleInfo bundleInfo = state.bundleInfos.get(bundleId);
                        if (bundleInfo == null || bundleInfo.isStart()) {
                            try {
                                if (!options.contains(Option.NoAutoStartBundles)) {
                                    b.start();
                                }
                            } catch (BundleException be) {
View Full Code Here

                    if (state.installed.contains(b)
                            || (b.getState() != Bundle.STARTING && b.getState() != Bundle.ACTIVE
                            && getStartLevel().isBundlePersistentlyStarted(b))) {
                        // do no start bundles when user request it
                        Long bundleId = b.getBundleId();
                        BundleInfo bundleInfo = state.bundleInfos.get(bundleId);
                        if (bundleInfo == null || bundleInfo.isStart()) {
                            try {
                                b.start();
                            } catch (BundleException be) {
                                String msg = format("Could not start bundle %s in feature(s) %s: %s", b.getLocation(), getFeaturesContainingBundleList(b), be.getMessage());
                                throw new Exception(msg, be);
View Full Code Here

                    if (state.installed.contains(b)
                            || (b.getState() != Bundle.STARTING && b.getState() != Bundle.ACTIVE
                                    && getStartLevel().isBundlePersistentlyStarted(b))) {
                      // do no start bundles when user request it
                      Long bundleId = b.getBundleId();
                      BundleInfo bundleInfo = state.bundleInfos.get(bundleId);
                        if (bundleInfo == null || bundleInfo.isStart()) {
                          try {
                              b.start();
                          } catch (BundleException be) {
                              String[] msgdata = new String[]{
                                  b.getLocation(),
View Full Code Here

                    if (state.installed.contains(b)
                            || (b.getState() != Bundle.STARTING && b.getState() != Bundle.ACTIVE
                                    && getStartLevel().isBundlePersistentlyStarted(b))) {
                      // do no start bundles when user request it
                      Long bundleId = b.getBundleId();
                      BundleInfo bundleInfo = state.bundleInfos.get(bundleId);
                        if (bundleInfo == null || bundleInfo.isStart()) {
                          try {
                              b.start();
                          } catch (BundleException be) {
                              String msg = format("Could not start bundle %s in feature(s) %s: %s", b.getLocation(), getFeaturesContainingBundleList(b), be.getMessage());
                              throw new Exception(msg, be);
View Full Code Here

        replay(feature);
        return feature;
    }

    private static BundleInfo createMockBundleInfo(String location, boolean dependency) {
        BundleInfo info = createNiceMock(BundleInfo.class);
        expect(info.getLocation()).andReturn(location).anyTimes();
        expect(info.isDependency()).andReturn(dependency).anyTimes();
        replay(info);
        return info;
    }
View Full Code Here

        Map<Resource, Integer> startLevels = new HashMap<>();
        Map<Bundle, Integer> toUpdateStartLevel = new HashMap<>();
        for (Map.Entry<String, Set<Resource>> entry : resolver.getBundlesPerRegions().entrySet()) {
            String region = entry.getKey();
            for (Resource resource : entry.getValue()) {
                BundleInfo bi = bundleInfos.get(region).get(getUri(resource));
                if (bi != null) {
                    int sl = bi.getStartLevel() > 0 ? bi.getStartLevel() : dstate.initialBundleStartLevel;
                    startLevels.put(resource, sl);
                    Bundle bundle = deployment.resToBnd.get(resource);
                    if (bundle != null) {
                        int curSl = bundle.adapt(BundleStartLevel.class).getStartLevel();
                        if (sl != curSl) {
View Full Code Here

TOP

Related Classes of org.apache.karaf.features.BundleInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.