Search in sources :

Example 6 with Bundle

use of org.datanucleus.plugin.Bundle in project datanucleus-core by datanucleus.

the class OSGiBundleParser method getRequireBundle.

/**
 * Accessor for the Bundle-Name from the manifest.mf file
 * @param mf the manifest
 * @return the Set with BundleDescription
 */
private static List<Bundle.BundleDescription> getRequireBundle(Dictionary<String, String> headers) {
    String str = headers.get("Require-Bundle");
    if (str == null || str.length() < 1) {
        return Collections.emptyList();
    }
    Parser p = new Parser(str);
    List<Bundle.BundleDescription> requiredBundle = new ArrayList<Bundle.BundleDescription>();
    String bundleSymbolicName = p.parseSymbolicName();
    while (bundleSymbolicName != null) {
        Bundle.BundleDescription bd = new Bundle.BundleDescription();
        bd.setBundleSymbolicName(bundleSymbolicName);
        bd.setParameters(p.parseParameters());
        bundleSymbolicName = p.parseSymbolicName();
        requiredBundle.add(bd);
    }
    return requiredBundle;
}
Also used : Bundle(org.datanucleus.plugin.Bundle) ArrayList(java.util.ArrayList) Parser(org.datanucleus.plugin.PluginParser.Parser)

Aggregations

Bundle (org.datanucleus.plugin.Bundle)6 ClassLoaderResolver (org.datanucleus.ClassLoaderResolver)3 ClassLoaderResolverImpl (org.datanucleus.ClassLoaderResolverImpl)3 Extension (org.datanucleus.plugin.Extension)3 NonManagedPluginRegistry (org.datanucleus.plugin.NonManagedPluginRegistry)3 ArrayList (java.util.ArrayList)2 ExtensionPoint (org.datanucleus.plugin.ExtensionPoint)2 URL (java.net.URL)1 List (java.util.List)1 DocumentBuilder (javax.xml.parsers.DocumentBuilder)1 NucleusException (org.datanucleus.exceptions.NucleusException)1 ConfigurationElement (org.datanucleus.plugin.ConfigurationElement)1 Parser (org.datanucleus.plugin.PluginParser.Parser)1 BundleContext (org.osgi.framework.BundleContext)1