Add missing R4.3 RESOLUTION_DYNAMIC constants. (FELIX-2950)
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1152879 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/resolver/Candidates.java b/framework/src/main/java/org/apache/felix/framework/resolver/Candidates.java
index 3ff3791..1022546 100644
--- a/framework/src/main/java/org/apache/felix/framework/resolver/Candidates.java
+++ b/framework/src/main/java/org/apache/felix/framework/resolver/Candidates.java
@@ -32,6 +32,7 @@
import java.util.TreeSet;
import org.apache.felix.framework.BundleRevisionImpl;
import org.apache.felix.framework.resolver.Resolver.ResolverState;
+import org.apache.felix.framework.util.FelixConstants;
import org.apache.felix.framework.util.Util;
import org.apache.felix.framework.wiring.BundleCapabilityImpl;
import org.apache.felix.framework.wiring.BundleRequirementImpl;
@@ -201,7 +202,8 @@
String resolution = req.getDirectives().get(Constants.RESOLUTION_DIRECTIVE);
if (!state.isEffective(req)
// TODO: OSGi R4.3 - Use proper "dynamic" constant.
- || ((resolution != null) && resolution.equals("dynamic")))
+ || ((resolution != null)
+ && resolution.equals(FelixConstants.RESOLUTION_DYNAMIC)))
{
continue;
}
diff --git a/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java b/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
index dd31e0e..021848a 100644
--- a/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
@@ -40,7 +40,7 @@
import org.osgi.framework.wiring.BundleRevision;
import org.osgi.framework.wiring.BundleWire;
-// TODO: OSGi R.4.3 - Make sure we have sufficient wrapping of caps/reqs.
+// TODO: OSGi R4.3 - Make sure we have sufficient wrapping of caps/reqs.
public class ResolverImpl implements Resolver
{
private final Logger m_logger;
@@ -856,7 +856,7 @@
{
if (req.getNamespace().equals(BundleRevision.BUNDLE_NAMESPACE))
{
-// TODO: OSGi R.4.3 - Something doesn't seem correct here since we don't calculate
+// TODO: OSGi R4.3 - Something doesn't seem correct here since we don't calculate
// reexported packages for resolved bundles. Create a test case.
String value = req.getDirectives().get(Constants.VISIBILITY_DIRECTIVE);
if ((value != null) && value.equals(Constants.VISIBILITY_REEXPORT)
diff --git a/framework/src/main/java/org/apache/felix/framework/util/FelixConstants.java b/framework/src/main/java/org/apache/felix/framework/util/FelixConstants.java
index b4e8ad0..df8ba28 100644
--- a/framework/src/main/java/org/apache/felix/framework/util/FelixConstants.java
+++ b/framework/src/main/java/org/apache/felix/framework/util/FelixConstants.java
@@ -20,48 +20,48 @@
public interface FelixConstants extends org.osgi.framework.Constants
{
- public static final String SYSTEM_BUNDLE_SYMBOLICNAME = "org.apache.felix.framework";
+ String SYSTEM_BUNDLE_SYMBOLICNAME = "org.apache.felix.framework";
// Framework constants and values.
- public static final String FRAMEWORK_VERSION_VALUE = "1.5";
- public static final String FRAMEWORK_VENDOR_VALUE = "Apache Software Foundation";
+ String FRAMEWORK_VERSION_VALUE = "1.5";
+ String FRAMEWORK_VENDOR_VALUE = "Apache Software Foundation";
// Framework constants and values.
- public static final String FELIX_VERSION_PROPERTY = "felix.version";
+ String FELIX_VERSION_PROPERTY = "felix.version";
// Miscellaneous manifest constants.
- public static final String DIRECTIVE_SEPARATOR = ":=";
- public static final String ATTRIBUTE_SEPARATOR = "=";
- public static final String CLASS_PATH_SEPARATOR = ",";
- public static final String CLASS_PATH_DOT = ".";
- public static final String PACKAGE_SEPARATOR = ";";
- public static final String VERSION_SEGMENT_SEPARATOR = ".";
- public static final int VERSION_SEGMENT_COUNT = 3;
- public static final String BUNDLE_NATIVECODE_OPTIONAL = "*";
+ String DIRECTIVE_SEPARATOR = ":=";
+ String ATTRIBUTE_SEPARATOR = "=";
+ String CLASS_PATH_SEPARATOR = ",";
+ String CLASS_PATH_DOT = ".";
+ String PACKAGE_SEPARATOR = ";";
+ String VERSION_SEGMENT_SEPARATOR = ".";
+ int VERSION_SEGMENT_COUNT = 3;
+ String BUNDLE_NATIVECODE_OPTIONAL = "*";
// Miscellaneous OSGi constants.
- public static final String BUNDLE_URL_PROTOCOL = "bundle";
+ String BUNDLE_URL_PROTOCOL = "bundle";
// Miscellaneous framework configuration property names.
- public static final String FRAMEWORK_BUNDLECACHE_IMPL
- = "felix.bundlecache.impl";
- public static final String LOG_LEVEL_PROP = "felix.log.level";
- public static final String LOG_LOGGER_PROP = "felix.log.logger";
- public static final String SYSTEMBUNDLE_ACTIVATORS_PROP
- = "felix.systembundle.activators";
- public static final String BUNDLE_STARTLEVEL_PROP
- = "felix.startlevel.bundle";
- public static final String SERVICE_URLHANDLERS_PROP = "felix.service.urlhandlers";
- public static final String IMPLICIT_BOOT_DELEGATION_PROP = "felix.bootdelegation.implicit";
- public static final String BOOT_CLASSLOADERS_PROP = "felix.bootdelegation.classloaders";
- public static final String USE_LOCALURLS_PROP = "felix.jarurls";
+ String FRAMEWORK_BUNDLECACHE_IMPL = "felix.bundlecache.impl";
+ String LOG_LEVEL_PROP = "felix.log.level";
+ String LOG_LOGGER_PROP = "felix.log.logger";
+ String SYSTEMBUNDLE_ACTIVATORS_PROP = "felix.systembundle.activators";
+ String BUNDLE_STARTLEVEL_PROP = "felix.startlevel.bundle";
+ String SERVICE_URLHANDLERS_PROP = "felix.service.urlhandlers";
+ String IMPLICIT_BOOT_DELEGATION_PROP = "felix.bootdelegation.implicit";
+ String BOOT_CLASSLOADERS_PROP = "felix.bootdelegation.classloaders";
+ String USE_LOCALURLS_PROP = "felix.jarurls";
+
+ // Missing OSGi constant for resolution directive.
+ String RESOLUTION_DYNAMIC = "dynamic";
// Start level-related constants.
- public static final int FRAMEWORK_INACTIVE_STARTLEVEL = 0;
- public static final int FRAMEWORK_DEFAULT_STARTLEVEL = 1;
- public static final int SYSTEMBUNDLE_DEFAULT_STARTLEVEL = 0;
- public static final int BUNDLE_DEFAULT_STARTLEVEL = 1;
+ int FRAMEWORK_INACTIVE_STARTLEVEL = 0;
+ int FRAMEWORK_DEFAULT_STARTLEVEL = 1;
+ int SYSTEMBUNDLE_DEFAULT_STARTLEVEL = 0;
+ int BUNDLE_DEFAULT_STARTLEVEL = 1;
// Miscellaneous properties values.
- public static final String FAKE_URL_PROTOCOL_VALUE = "location:";
- public static final String FELIX_EXTENSION_ACTIVATOR = "Felix-Activator";
+ String FAKE_URL_PROTOCOL_VALUE = "location:";
+ String FELIX_EXTENSION_ACTIVATOR = "Felix-Activator";
}
\ No newline at end of file
diff --git a/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java b/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java
index b806f95..3647d2a 100644
--- a/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java
+++ b/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java
@@ -487,8 +487,8 @@
// Add the resolution directive to indicate that these are
// dynamic imports.
-// TODO: OSGi R4.3 - Use real constant value for "dynamic".
- clause.m_dirs.put(Constants.RESOLUTION_DIRECTIVE, "dynamic");
+ clause.m_dirs.put(Constants.RESOLUTION_DIRECTIVE,
+ FelixConstants.RESOLUTION_DYNAMIC);
// Check for "version" and "specification-version" attributes
// and verify they are the same if both are specified.