Examples of BundleStore


Examples of org.papoose.core.spi.BundleStore

        if (locations.containsKey(Constants.SYSTEM_BUNDLE_LOCATION)) throw new BundleException("System bundle already installed");

        final long systemBundleId = 0;
        try
        {
            BundleStore bundleStore = store.obtainSystemBundleStore();

            BundleController systemBundle = new SystemBundleController(framework, bundleStore, version);

            NameVersionKey key = new NameVersionKey(systemBundle.getSymbolicName(), version);

            if (nameVersions.containsKey(key)) throw new BundleException("Bundle already registered with name " + key.getSymbolicName() + " and version " + key.getVersion());

            nameVersions.put(key, systemBundle);
            locations.put(Constants.SYSTEM_BUNDLE_LOCATION, systemBundle);
            installedbundles.put(systemBundleId, systemBundle);
            bundles.put(systemBundleId, systemBundle);

            framework.getResolver().added(systemBundle.getCurrentGeneration());

            insertSystemClassLoader((BundleGeneration) systemBundle.getCurrentGeneration());

            bundleStore.markModified();

            LOGGER.exiting(CLASS_NAME, "installSystemBundle", systemBundle);

            return systemBundle;
        }
View Full Code Here

Examples of org.papoose.core.spi.BundleStore

        long bundleId = bundleCounter.incrementAndGet();

        try
        {
            BundleStore bundleStore = store.allocateBundleStore(bundleId, location);

            ArchiveStore archiveStore = store.allocateArchiveStore(framework, bundleId, inputStream);

            if (!archiveStore.getBundleNativeCodeList().isEmpty()) archiveStore.assignNativeCodeDescriptions(resolveNativeCodeDependencies(archiveStore.getBundleNativeCodeList()));

            confirmRequiredExecutionEnvironment(archiveStore.getBundleRequiredExecutionEnvironment());

            BundleController bundle = new BundleController(framework, bundleStore);

            Generation generation = allocateGeneration(bundle, archiveStore);

            bundle.getGenerations().put(archiveStore.getGeneration(), generation);
            bundle.setCurrentGeneration(generation);

            NameVersionKey key = new NameVersionKey(archiveStore.getBundleSymbolicName(), archiveStore.getBundleVersion());

            if (nameVersions.containsKey(key)) throw new BundleException("Bundle already registered with name " + key.getSymbolicName() + " and version " + key.getVersion());

            SecurityUtils.checkAdminPermission(bundle, AdminPermission.LIFECYCLE);
            if (generation instanceof ExtensionGeneration) SecurityUtils.checkAdminPermission(bundle, AdminPermission.EXTENSIONLIFECYCLE);

            nameVersions.put(key, bundle);
            locations.put(location, bundle);
            installedbundles.put(bundleId, bundle);
            bundles.put(bundleId, bundle);

            framework.getResolver().added(generation);

            bundleStore.markModified();

            generation.setState(Bundle.INSTALLED);

            fireBundleEvent(new BundleEvent(BundleEvent.INSTALLED, bundle));
View Full Code Here

Examples of org.papoose.core.spi.BundleStore

        File bundleRoot = new File(root, SYSTEM_DIR);

        if (!bundleRoot.exists() && !bundleRoot.mkdirs()) throw new FatalError("Unable to create bundle store location: " + bundleRoot);

        BundleStore result = new BundleTmpFileMemoryStore(bundleRoot, 0, Constants.SYSTEM_BUNDLE_LOCATION);

        LOGGER.exiting(CLASS_NAME, "obtainSystemBundleStore", result);

        return result;
    }
View Full Code Here

Examples of org.papoose.core.spi.BundleStore

        save();

        if (bundleRoot.exists()) throw new BundleException("Bundle store location " + bundleRoot + " already exists");
        if (!bundleRoot.mkdirs()) throw new FatalError("Unable to create bundle store location: " + bundleRoot);

        BundleStore result = new BundleTmpFileMemoryStore(bundleRoot, bundleId, location);

        LOGGER.exiting(CLASS_NAME, "allocateBundleStore", result);

        return result;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.