Package org.apache.geronimo.kernel.config

Examples of org.apache.geronimo.kernel.config.Manifest$Attribute


    public void removeImportPackages(Collection<String> importPackages) {
        this.imports.removeAll(importPackages);
    }

    public Manifest getManifest() throws ManifestException {
        Manifest manifest = new Manifest();
        manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_MANIFESTVERSION, "2"));
        manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_SYMBOLICNAME, configId.getGroupId() + "." + configId.getArtifactId()));
        String versionString = "" + configId.getVersion().getMajorVersion() + "." + configId.getVersion().getMinorVersion() + "." + configId.getVersion().getIncrementalVersion();
        if (configId.getVersion().getQualifier() != null) {
            versionString += "." + configId.getVersion().getQualifier().replaceAll("[^-_\\w]{1}", "_");
        }

        manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_VERSION, versionString));

        if (bundleActivator != null) {
            manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_ACTIVATOR, bundleActivator));
        }

        if (!imports.isEmpty()) {
            manifest.addConfiguredAttribute(new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.IMPORT_PACKAGE, imports));
        }

        if (!exports.isEmpty()) {
            manifest.addConfiguredAttribute(new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.EXPORT_PACKAGE, exports));
        }

        if (!dynamicImports.isEmpty()) {
            manifest.addConfiguredAttribute(new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.DYNAMICIMPORT_PACKAGE, dynamicImports));
        }

        if (!bundleClassPath.isEmpty()) {
            Manifest.Attribute bundleClassPath = new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.BUNDLE_CLASSPATH, this.bundleClassPath);
            manifest.addConfiguredAttribute(bundleClassPath);
        }

        if (!requireBundles.isEmpty()) {
            Manifest.Attribute requireBundle = new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.REQUIRE_BUNDLE, this.requireBundles);
            manifest.addConfiguredAttribute(requireBundle);
        }
        return manifest;
    }
View Full Code Here


                b.uninstall();
                break;
            }
        }
        //2. Generate the MANIFEST.MF file for the share library
        Manifest manifest = new Manifest();
        manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_MANIFESTVERSION, "2"));
        Artifact configId = name.getArtifact();
        manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_SYMBOLICNAME, configId.getGroupId() + "." + configId.getArtifactId() + "." + name.getNameProperty("name")));
        String versionString = "" + configId.getVersion().getMajorVersion() + "." + configId.getVersion().getMinorVersion() + "." + configId.getVersion().getIncrementalVersion();
        if (configId.getVersion().getQualifier() != null) {
            versionString += "." + configId.getVersion().getQualifier().replaceAll("[^-_\\w]{1}", "_");
        }
        manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_VERSION, versionString));
        Set<String> bundleClassPaths = generateBundleClassPath();
        if (bundleClassPaths.size() > 0) {
            Manifest.Attribute bundleClassPath = new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.BUNDLE_CLASSPATH, bundleClassPaths);
            manifest.addConfiguredAttribute(bundleClassPath);
        }
        //import packages, dynamic import packages and required bundles are from the configuration bundle.
        String importPackages = (String)bundleContext.getBundle().getHeaders().get(Constants.IMPORT_PACKAGE);
        if (importPackages != null) {
            manifest.addConfiguredAttribute(new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.IMPORT_PACKAGE, importPackages));
        }
        String dynamicImportPackages = (String)bundleContext.getBundle().getHeaders().get(Constants.DYNAMICIMPORT_PACKAGE);
        if (dynamicImportPackages != null) {
            List<HeaderElement> headerElements = HeaderParser.parseHeader(dynamicImportPackages);
            //From shared library perspective, dynamic * should not be used
            for (Iterator<HeaderElement> it = headerElements.iterator(); it.hasNext();) {
                if (it.next().getName().equals("*")) {
                    it.remove();
                }
            }
            if (headerElements.size() > 0) {
                manifest.addConfiguredAttribute(new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.DYNAMICIMPORT_PACKAGE, HeaderBuilder.build(headerElements)));
            }
        }
        String requiredBundles = (String)bundleContext.getBundle().getHeaders().get(Constants.REQUIRE_BUNDLE);
        if (requiredBundles != null) {
            manifest.addConfiguredAttribute(new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.REQUIRE_BUNDLE, requiredBundles));
        }
        //3. Write the MANIFEST.MF file
        File metaInf = new File(baseFolder, "META-INF");
        metaInf.mkdirs();
        PrintWriter pw = null;
        try {
            pw = new PrintWriter(new FileWriter(new File(metaInf, "MANIFEST.MF")));
            manifest.write(pw);
        } finally {
            IOUtils.close(pw);
        }
        //4. Install the bundle
        sharedLibBundle = bundleContext.installBundle(bundleLocation);
View Full Code Here

        try {
            osgiMetaDataBuilder.build(env);
        } catch (IllegalConfigurationException e) {
            throw new DeploymentException(e);
        }
        Manifest manifest;
        try {
            manifest = env.getManifest();
        } catch (ManifestException e) {
            throw new DeploymentException(e);
        }

        File metaInf = new File(getConfigurationDir(), "META-INF");
        metaInf.mkdirs();
        FileWriter fw = new FileWriter(new File(metaInf, "MANIFEST.MF"));
        PrintWriter pw = new PrintWriter(fw);
        try {
            manifest.write(pw);
        } finally {
            pw.close();
            fw.close();
        }
    }
View Full Code Here

        try {
            osgiMetaDataBuilder.build(env);
        } catch (IllegalConfigurationException e) {
            throw new DeploymentException(e);
        }
        Manifest manifest;
        try {
            manifest = env.getManifest();
        } catch (ManifestException e) {
            throw new DeploymentException(e);
        }

        File metaInf = new File(getConfigurationDir(), "META-INF");
        metaInf.mkdirs();
        FileWriter fw = new FileWriter(new File(metaInf, "MANIFEST.MF"));
        PrintWriter pw = new PrintWriter(fw);
        try {
            manifest.write(pw);
        } finally {
            pw.close();
            fw.close();
        }
    }
View Full Code Here

                b.uninstall();
                break;
            }
        }
        //2. Generate the MANIFEST.MF file for the share library
        Manifest manifest = new Manifest();
        manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_MANIFESTVERSION, "2"));
        Artifact configId = name.getArtifact();
        manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_SYMBOLICNAME, configId.getGroupId() + "." + configId.getArtifactId() + "." + name.getNameProperty("name")));
        String versionString = "" + configId.getVersion().getMajorVersion() + "." + configId.getVersion().getMinorVersion() + "." + configId.getVersion().getIncrementalVersion();
        if (configId.getVersion().getQualifier() != null) {
            versionString += "." + configId.getVersion().getQualifier().replaceAll("[^-_\\w]{1}", "_");
        }
        manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_VERSION, versionString));
        Set<String> bundleClassPaths = generateBundleClassPath();
        if (bundleClassPaths.size() > 0) {
            Manifest.Attribute bundleClassPath = new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.BUNDLE_CLASSPATH, bundleClassPaths);
            manifest.addConfiguredAttribute(bundleClassPath);
        }
        //import packages, dynamic import packages and required bundles are from the configuration bundle.
        String importPackages = (String)bundleContext.getBundle().getHeaders().get(Constants.IMPORT_PACKAGE);
        if (importPackages != null) {
            manifest.addConfiguredAttribute(new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.IMPORT_PACKAGE, importPackages));
        }
        String dynamicImportPackages = (String)bundleContext.getBundle().getHeaders().get(Constants.DYNAMICIMPORT_PACKAGE);
        if (dynamicImportPackages != null) {
            List<HeaderElement> headerElements = HeaderParser.parseHeader(dynamicImportPackages);
            //From shared library perspective, dynamic * should not be used
            /*for (Iterator<HeaderElement> it = headerElements.iterator(); it.hasNext();) {
                if (it.next().getName().equals("*")) {
                    it.remove();
                }
            }*/
            if (headerElements.size() > 0) {
                manifest.addConfiguredAttribute(new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.DYNAMICIMPORT_PACKAGE, HeaderBuilder.build(headerElements)));
            }
        }
        String requiredBundles = (String)bundleContext.getBundle().getHeaders().get(Constants.REQUIRE_BUNDLE);
        if (requiredBundles != null) {
            manifest.addConfiguredAttribute(new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.REQUIRE_BUNDLE, requiredBundles));
        }
        //3. Write the MANIFEST.MF file
        File metaInf = new File(baseFolder, "META-INF");
        metaInf.mkdirs();
        PrintWriter pw = null;
        try {
            pw = new PrintWriter(new FileWriter(new File(metaInf, "MANIFEST.MF")));
            manifest.write(pw);
        } finally {
            IOUtils.close(pw);
        }
        //4. Install the bundle
        sharedLibBundle = bundleContext.installBundle(bundleLocation);
View Full Code Here

    public List<String> getRequireBundles() {
        return Collections.unmodifiableList(new ArrayList<String>(requireBundles));
    }

    public Manifest getManifest() throws ManifestException {
        Manifest manifest = new Manifest();
        manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_MANIFESTVERSION, "2"));
        manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_SYMBOLICNAME, configId.getGroupId() + "." + configId.getArtifactId()));
        String versionString = "" + configId.getVersion().getMajorVersion() + "." + configId.getVersion().getMinorVersion() + "." + configId.getVersion().getIncrementalVersion();
        if (configId.getVersion().getQualifier() != null) {
            versionString += "." + configId.getVersion().getQualifier().replaceAll("[^-_\\w]{1}", "_");
        }

        manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_VERSION, versionString));

        if (bundleActivator != null) {
            manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_ACTIVATOR, bundleActivator));
        }

        if (!imports.isEmpty()) {
            manifest.addConfiguredAttribute(new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.IMPORT_PACKAGE, imports));
        }
        if (!exports.isEmpty()) {
            manifest.addConfiguredAttribute(new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.EXPORT_PACKAGE, exports));
        }
        manifest.addConfiguredAttribute(new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.DYNAMICIMPORT_PACKAGE, "*"));

        if (!bundleClassPath.isEmpty()) {
            Manifest.Attribute bundleClassPath = new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.BUNDLE_CLASSPATH, this.bundleClassPath);
            manifest.addConfiguredAttribute(bundleClassPath);
        }

        if (!requireBundles.isEmpty()) {
            Manifest.Attribute requireBundle = new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.REQUIRE_BUNDLE, this.requireBundles);
            manifest.addConfiguredAttribute(requireBundle);
        }
        return manifest;
    }
View Full Code Here

        Artifact id = env.getConfigId();
        env.setConfigId(new Artifact(id.getGroupId(), id.getArtifactId() + "-DEPLOYMENT", id.getVersion(), id.getType()));
        env.addToBundleClassPath(classPath);
        env.setBundleActivator(null);

        Manifest manifest;
        try {
            manifest = env.getManifest();
        } catch (ManifestException e) {
            throw new DeploymentException(e);
        }

        File metaInf = new File(getConfigurationDir(), "META-INF");
        metaInf.mkdirs();
        FileWriter fw = new FileWriter(new File(metaInf, "MANIFEST.MF"));
        PrintWriter pw = new PrintWriter(fw);
        try {
            manifest.write(pw);
        } finally {
            pw.close();
            fw.close();
        }
    }
View Full Code Here

        try {
            osgiMetaDataBuilder.build(env);
        } catch (IllegalConfigurationException e) {
            throw new DeploymentException(e);
        }
        Manifest manifest;
        try {
            manifest = env.getManifest();
        } catch (ManifestException e) {
            throw new DeploymentException(e);
        }

        File metaInf = new File(getConfigurationDir(), "META-INF");
        metaInf.mkdirs();
        FileWriter fw = new FileWriter(new File(metaInf, "MANIFEST.MF"));
        PrintWriter pw = new PrintWriter(fw);
        try {
            manifest.write(pw);
        } finally {
            pw.close();
            fw.close();
        }
    }
View Full Code Here

                                {
                                    skey.textToShow = trans.get(f);
                                    f = org.size();
                                }

                            Attribute a;
                            if ((a = keyEl.getAttribute(length)) != null)
                                skey.keyWidth = Integer.parseInt(a.getValue());

                            line.add(skey);
                        } else
                            line.add(SpecialKey.getKeyboardKey(fontName, special));
                    }
View Full Code Here

    this.handleQCInformation();

    this.ncFile.addAttribute( null, qcFlagsAtt );

    // Add some general metadata in global attributes.
    this.ncFile.addAttribute( null, new Attribute( "title",
                                                   new StringBuffer("NGDC archived ")
                                                   .append( datasetIdAtt.getStringValue())
                                                   .append( " data with start time ")
                                                   .append( startDateAtt.getStringValue())
                                                   .toString()));
    this.ncFile.addAttribute( null, new Attribute( "Convention", _Coordinate.Convention));

    // Add some THREDDS specific metadata in global attributes.
    this.ncFile.addAttribute( null, new Attribute( "thredds_creator", "DOD/USAF/SMC > Space and Missile Systems Center (SMC), U.S. Air Force, U.S. Department of Defense"));
    this.ncFile.addAttribute( null, new Attribute( "thredds_contributor", "DOC/NOAA/NESDIS/NGDC > National Geophysical Data Center, NESDIS, NOAA, U.S. Department of Commerce"));
    this.ncFile.addAttribute( null, new Attribute( "thredds_contributor_role", "archive"));
    this.ncFile.addAttribute( null, new Attribute( "thredds_publisher", "DOC/NOAA/NESDIS/NGDC > National Geophysical Data Center, NESDIS, NOAA, U.S. Department of Commerce"));
    this.ncFile.addAttribute( null, new Attribute( "thredds_publisher_url", "http://dmsp.ngdc.noaa.gov/"));
    this.ncFile.addAttribute( null, new Attribute( "thredds_publisher_email", "ngdc.dmsp@noaa.gov"));
    this.ncFile.addAttribute( null, new Attribute( "thredds_summary",
                                                   new StringBuffer("This dataset contains data from the DMSP ").append( spacecraftIdAtt.getStringValue())
                                                   .append( " satellite OLS instrument and includes both visible smooth and thermal smooth imagery with 2.7km resolution.")
                                                   .append( " The start time for this data is ").append( startDateAtt.getStringValue())
                                                   .append( " and the northerly equatorial crossing longitude is ").append( startLongitudeAtt.getNumericValue())
                                                   .append( ".  The DMSP satellite is a polar-orbiting satellite crossing the equator, depending on the satellite, at either dawn/dusk or noon/midnight.")
                                                   .append( " This data is in the NOAA/NGDC DMSP archive format.")
                                                   .toString()));
    this.ncFile.addAttribute( null, new Attribute( "thredds_history", ""));
    this.ncFile.addAttribute( null, new Attribute( "thredds_timeCoverage_start", startDateAtt.getStringValue()));
    this.ncFile.addAttribute( null, new Attribute( "thredds_timeCoverage_end", endDateAtt.getStringValue()));
    this.ncFile.addAttribute( null, new Attribute( "thredds_geospatialCoverage",
                                                   new StringBuffer("Polar orbit with northerly equatorial crossing at longitude ")
                                                   .append( ascendingNodeAtt.getNumericValue()).append( ".")
                                                   .toString()));

View Full Code Here

TOP

Related Classes of org.apache.geronimo.kernel.config.Manifest$Attribute

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.