Examples of ArchiveStore


Examples of org.papoose.core.spi.ArchiveStore

                while (bundleCounter.get() < bundleStore.getBundleId()) bundleCounter.incrementAndGet();

                long bundleId = bundleStore.getBundleId();

                String location = bundleStore.getLocation();
                ArchiveStore archiveStore = store.loadArchiveStore(framework, bundleId);

                // todo: this always seemed kinda a wacky way to do this
                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());

                nameVersions.put(key, bundle);
                locations.put(location, bundle);
View Full Code Here

Examples of org.papoose.core.spi.ArchiveStore

            if (!bundleGeneration.getStarting().tryLock(10000, TimeUnit.MILLISECONDS)) throw new BundleException("Timeout waiting for bundle to start");

            if (bundleGeneration.getState() == Bundle.ACTIVE) return;

            BundleController bundleController = bundleGeneration.getBundleController();
            ArchiveStore archiveStore = bundleGeneration.getArchiveStore();
            LazyActivationDescription lazyActivationDescription = archiveStore.getLazyActivationDescription();
            if (options != Bundle.START_TRANSIENT)
            {
                if (lazyActivationDescription.isLazyActivation())
                {
                    bundleController.setAutostart(AutostartSetting.ACTIVATION_POLICY);
View Full Code Here

Examples of org.papoose.core.spi.ArchiveStore

            if (!bundleGeneration.getStarting().tryLock(10000, TimeUnit.MILLISECONDS)) throw new BundleException("Timeout waiting for bundle to start");

            if (bundleGeneration.getState() != Bundle.STARTING) return;

            final BundleController bundleController = bundleGeneration.getBundleController();
            ArchiveStore archiveStore = bundleGeneration.getArchiveStore();

            fireBundleEvent(new BundleEvent(BundleEvent.STARTING, bundleController));

            bundleGeneration.getClassLoader().setLazyActivation(false);

            try
            {
                String bundleActivatorClassName = archiveStore.getBundleActivatorClass();
                if (bundleActivatorClassName != null)
                {
                    Class bundleActivatorClass = bundleGeneration.getClassLoader().loadClass(bundleActivatorClassName);

                    if (bundleActivatorClass == null) throw new BundleException("Bundle activator class " + bundleActivatorClassName + " not found");
View Full Code Here

Examples of org.papoose.core.spi.ArchiveStore

        }
    }

    private void insertSystemClassLoader(BundleGeneration bundle) throws BundleException
    {
        ArchiveStore currentStore = bundle.getArchiveStore();

        Set<String> exportedPackages = new HashSet<String>();

        for (ExportDescription desc : currentStore.getExportDescriptions())
        {
            exportedPackages.addAll(desc.getPackageNames());
        }

        Set<ArchiveStore> archiveStores = new HashSet<ArchiveStore>();

        archiveStores.add(currentStore);
        for (FragmentGeneration fragment : bundle.getFragments()) archiveStores.add(fragment.getArchiveStore());

        List<ResourceLocation> resourceLocations = new ArrayList<ResourceLocation>();

        for (String element : currentStore.getBundleClassPath())
        {
            ResourceLocation resourceLocation = currentStore.registerClassPathElement(element);
            if (resourceLocation == null)
            {
                for (FragmentGeneration fragment : bundle.getFragments())
                {
                    resourceLocation = fragment.getArchiveStore().registerClassPathElement(element);

                    if (resourceLocation != null) break;
                }
            }
            if (resourceLocation != null) resourceLocations.add(resourceLocation);
        }

        for (FragmentGeneration fragment : bundle.getFragments())
        {
            ArchiveStore archiveStore = fragment.getArchiveStore();

            for (String element : archiveStore.getBundleClassPath())
            {
                ResourceLocation resourceLocation = archiveStore.registerClassPathElement(element);
                if (resourceLocation != null) resourceLocations.add(resourceLocation);
            }
        }

        /**
 
View Full Code Here

Examples of org.papoose.core.spi.ArchiveStore

        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);
View Full Code Here

Examples of org.papoose.core.spi.ArchiveStore

    }

    private void finishResolution(Solution solution) throws BundleException
    {
        BundleGeneration bundleGeneration = solution.getBundle();
        ArchiveStore currentStore = bundleGeneration.getArchiveStore();
        Set<Wire> wires = solution.getWires();

        for (Wire wire : wires)
        {
            wire.getExportDescription().incrementReferenceCount();
        }

        Set<String> exportedPackages = new HashSet<String>();
        for (ExportDescription desc : currentStore.getExportDescriptions())
        {
            exportedPackages.addAll(desc.getPackageNames());
        }

        List<Wire> requiredBundles = new ArrayList<Wire>();
        for (Solution.RequiredBundleWrapper wrapper : solution.getRequiredBundles())
        {
            Wire wire = wrapper.getWire();

            requiredBundles.add(wire);
            bundleGeneration.getRequiredBundles().add(wire.getBundleGeneration());

            if (wrapper.isReExport())
            {
                exportedPackages.add(wire.getPackageName());
            }
        }

        Set<ArchiveStore> archiveStores = new HashSet<ArchiveStore>();

        archiveStores.add(currentStore);
        for (FragmentGeneration fragment : solution.getFragments()) archiveStores.add(fragment.getArchiveStore());

        List<ResourceLocation> resourceLocations = new ArrayList<ResourceLocation>();

        for (String element : currentStore.getBundleClassPath())
        {
            ResourceLocation resourceLocation = currentStore.registerClassPathElement(element);
            if (resourceLocation == null)
            {
                for (FragmentGeneration fragment : solution.getFragments())
                {
                    resourceLocation = fragment.getArchiveStore().registerClassPathElement(element);

                    if (resourceLocation != null) break;
                }
            }
            if (resourceLocation != null) resourceLocations.add(resourceLocation);
        }

        for (FragmentGeneration fragment : solution.getFragments())
        {
            ArchiveStore archiveStore = fragment.getArchiveStore();

            for (String element : archiveStore.getBundleClassPath())
            {
                ResourceLocation resourceLocation = archiveStore.registerClassPathElement(element);
                if (resourceLocation != null) resourceLocations.add(resourceLocation);
            }

            fragment.setHost(bundleGeneration);
            bundleGeneration.getFragments().add(fragment);
View Full Code Here

Examples of org.papoose.core.spi.ArchiveStore

    public Dictionary getHeaders(String locale)
    {
        SecurityManager sm = System.getSecurityManager();
        if (sm != null) sm.checkPermission(new AdminPermission(this, AdminPermission.METADATA));

        ArchiveStore archiveStore = getCurrentGeneration().getArchiveStore();

        if (locale != null && locale.length() == 0) return AttributeUtils.allocateReadOnlyDictionary(archiveStore.getAttributes());

        L18nResourceBundle parent = I18nUtils.loadResourceBundle(archiveStore, null, null);

        for (Locale intermediateLocale : I18nUtils.generateLocaleList(Locale.getDefault()))
        {
            parent = I18nUtils.loadResourceBundle(archiveStore, parent, intermediateLocale);
        }

        if (locale != null)
        {
            Locale target = I18nUtils.parseLocale(locale);
            if (!target.equals(Locale.getDefault()))
            {
                for (Locale intermediateLocale : I18nUtils.generateLocaleList(target))
                {
                    parent = I18nUtils.loadResourceBundle(archiveStore, parent, intermediateLocale);
                }
            }
        }

        return AttributeUtils.allocateReadOnlyI18nDictionary(archiveStore.getAttributes(), parent);
    }
View Full Code Here

Examples of org.papoose.core.spi.ArchiveStore

    public Resolved(BundleGeneration bundleGeneration)
    {
        super(bundleGeneration);

        final ArchiveStore archiveStore = bundleGeneration.getArchiveStore();
        for (ImportDescription description : archiveStore.getImportDescriptions())
        {
            for (String packageName : description.getPackageNames())
            {
                imports.add(new ImportDescriptionWrapper(packageName, description));
            }
        }
        for (ExportDescription description : archiveStore.getExportDescriptions())
        {
            exports.add(new ExportDescriptionWrapper(description, this));
        }
    }
View Full Code Here

Examples of org.papoose.core.spi.ArchiveStore

                LOGGER.log(Level.SEVERE, "Unable to parse generation id " + generation, nfe);
                throw new FatalError("Unable to parse generation id " + generation, nfe);
            }
        }

        ArchiveStore result = null;
        if (!generations.isEmpty())
        {
            int current = generations.last();

            if (current != Integer.parseInt(properties.getProperty(GENERATION_KEY + bundleId))) throw new FatalError("Generation store inconsistent with bundle store");
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.