Package org.apache.felix.deploymentadmin

Examples of org.apache.felix.deploymentadmin.BundleInfoImpl


        AbstractDeploymentPackage target = session.getTargetAbstractDeploymentPackage();
        LogService log = session.getLog();

        BundleInfoImpl[] orderedTargetBundles = target.getOrderedBundleInfos();
        for (int i = orderedTargetBundles.length - 1; i >= 0; i--) {
            BundleInfoImpl bundleInfo = orderedTargetBundles[i];
            // stale bundle, save a copy for rolling back and uninstall it
            String symbolicName = bundleInfo.getSymbolicName();
            try {
                Bundle bundle = target.getBundle(symbolicName);
                if (bundle != null) {
                    bundle.uninstall();
                    addRollback(new InstallBundleRunnable(bundle, target, log));
View Full Code Here


                if (entry == null) {
                    throw new DeploymentException(CODE_OTHER_ERROR, "Expected more bundles in the stream: " + expectedBundles.keySet());
                }

                String name = entry.getPath();
                BundleInfoImpl bundleInfo = (BundleInfoImpl) expectedBundles.remove(name);
                if (bundleInfo == null) {
                    throw new DeploymentException(CODE_OTHER_ERROR, "Resource '" + name + "' is not described in the manifest.");
                }

                String bsn = bundleInfo.getSymbolicName();
                Version sourceVersion = bundleInfo.getVersion();

                Bundle bundle = targetPackage.getBundle(bsn);
                try {
                    if (bundle == null) {
                        // new bundle, install it
View Full Code Here

     */
    private boolean omitBundleStop(DeploymentSessionImpl session, String symbolicName) {
        boolean stopUnaffectedBundle = session.getConfiguration().isStopUnaffectedBundles();

        boolean result = stopUnaffectedBundle;
        BundleInfoImpl sourceBundleInfo = session.getSourceAbstractDeploymentPackage().getBundleInfoByName(symbolicName);
        BundleInfoImpl targetBundleInfo = session.getTargetAbstractDeploymentPackage().getBundleInfoByName(symbolicName);
        boolean fixPackageMissing = sourceBundleInfo != null && sourceBundleInfo.isMissing();
        boolean sameVersion = (targetBundleInfo != null && sourceBundleInfo != null && targetBundleInfo.getVersion().equals(sourceBundleInfo.getVersion()));
        if (fixPackageMissing || sameVersion) {
            result = true;
        }
        return result;
    }
View Full Code Here

        session.getBundleContext().removeFrameworkListener(listener);

        // start source bundles
        BundleInfoImpl[] bundleInfos = source.getOrderedBundleInfos();
        for (int i = 0; i < bundleInfos.length; i++) {
            BundleInfoImpl bundleInfoImpl = bundleInfos[i];
            if (!bundleInfoImpl.isCustomizer()) {
                String symbolicName = bundleInfoImpl.getSymbolicName();

                Bundle bundle = source.getBundle(symbolicName);
                if (bundle != null) {
                    if (isFragmentBundle(bundle)) {
                        log.log(LogService.LOG_INFO, "Skipping fragment bundle '" + symbolicName + "'");
View Full Code Here

        AbstractDeploymentPackage source = session.getSourceAbstractDeploymentPackage();
        LogService log = session.getLog();

        BundleInfoImpl[] orderedTargetBundles = target.getOrderedBundleInfos();
        for (int i = orderedTargetBundles.length - 1; i >= 0; i--) {
            BundleInfoImpl bundleInfo = orderedTargetBundles[i];
            String symbolicName = bundleInfo.getSymbolicName();

            if (!bundleInfo.isCustomizer() && source.getBundleInfoByName(symbolicName) == null) {
                // stale bundle, save a copy for rolling back and uninstall it
                try {
                    Bundle bundle = target.getBundle(symbolicName);
                    bundle.uninstall();
                    addRollback(new InstallBundleRunnable(bundle, target, log));
View Full Code Here

        AbstractDeploymentPackage target = session.getTargetAbstractDeploymentPackage();
        LogService log = session.getLog();

        BundleInfoImpl[] orderedTargetBundles = target.getOrderedBundleInfos();
        for (int i = orderedTargetBundles.length - 1; i >= 0; i--) {
            BundleInfoImpl bundleInfo = orderedTargetBundles[i];
            // stale bundle, save a copy for rolling back and uninstall it
            String symbolicName = bundleInfo.getSymbolicName();
            try {
                Bundle bundle = target.getBundle(symbolicName);
                if (bundle != null) {
                    bundle.uninstall();
                    addRollback(new InstallBundleRunnable(bundle, target, log));
View Full Code Here

        AbstractDeploymentPackage source = session.getSourceAbstractDeploymentPackage();
        LogService log = session.getLog();

        BundleInfoImpl[] orderedTargetBundles = target.getOrderedBundleInfos();
        for (int i = orderedTargetBundles.length - 1; i >= 0; i--) {
            BundleInfoImpl bundleInfo = orderedTargetBundles[i];
            String symbolicName = bundleInfo.getSymbolicName();

            if (!bundleInfo.isCustomizer() && source.getBundleInfoByName(symbolicName) == null) {
                // stale bundle, save a copy for rolling back and uninstall it
                try {
                    Bundle bundle = target.getBundle(symbolicName);
                    bundle.uninstall();
                    addRollback(new InstallBundleRunnable(bundle, target, log));
View Full Code Here

                if (entry == null) {
                    throw new DeploymentException(DeploymentException.CODE_OTHER_ERROR, "Expected more bundles in the stream: " + expectedBundles.keySet());
                }

                String name = entry.getPath();
                BundleInfoImpl bundleInfo = (BundleInfoImpl) expectedBundles.remove(name);
                if (bundleInfo == null) {
                    throw new DeploymentException(DeploymentException.CODE_OTHER_ERROR, "Resource '" + name + "' is not described in the manifest.");
                }

                String bsn = bundleInfo.getSymbolicName();
                Version sourceVersion = bundleInfo.getVersion();

                Bundle bundle = targetPackage.getBundle(bsn);
                try {
                    if (bundle == null) {
                        // new bundle, install it
View Full Code Here

     *         version of the bundle is the same in both source and target
     *         deployment package. Returns <code>false</code> otherwise.
     */
    private boolean omitBundleStop(DeploymentSessionImpl session, String symbolicName) {
        boolean result = false;
        BundleInfoImpl sourceBundleInfo = session.getSourceAbstractDeploymentPackage().getBundleInfoByName(symbolicName);
        BundleInfoImpl targetBundleInfo = session.getTargetAbstractDeploymentPackage().getBundleInfoByName(symbolicName);
        boolean fixPackageMissing = sourceBundleInfo != null && sourceBundleInfo.isMissing();
        boolean sameVersion = (targetBundleInfo != null && sourceBundleInfo != null && targetBundleInfo.getVersion().equals(sourceBundleInfo.getVersion()));
        if (fixPackageMissing || sameVersion) {
            result = true;
        }
        return result;
    }
View Full Code Here

        session.getBundleContext().removeFrameworkListener(listener);

        // start source bundles
        BundleInfoImpl[] bundleInfos = source.getOrderedBundleInfos();
        for (int i = 0; i < bundleInfos.length; i++) {
            BundleInfoImpl bundleInfoImpl = bundleInfos[i];
            if (!bundleInfoImpl.isCustomizer()) {
                String symbolicName = bundleInfoImpl.getSymbolicName();

                Bundle bundle = source.getBundle(symbolicName);
                if (bundle != null) {
                    if (isFragmentBundle(bundle)) {
                        log.log(LogService.LOG_INFO, "Skipping fragment bundle '" + symbolicName + "'");
View Full Code Here

TOP

Related Classes of org.apache.felix.deploymentadmin.BundleInfoImpl

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.