Class Overrides
- java.lang.Object
-
- org.apache.karaf.features.internal.service.Overrides
-
public final class Overrides extends Object
Helper class to deal with overriden bundles at feature installation time.
-
-
Field Summary
Fields Modifier and Type Field Description static String
OVERRIDE_RANGE
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static String
extractUrl(String override)
static Set<String>
loadOverrides(String overridesUrl)
static <T extends org.osgi.resource.Resource>
voidoverride(Map<String,T> resources, Collection<String> overrides)
Deprecated.static <T extends org.osgi.resource.Resource>
voidoverride(Map<String,T> resources, Map<String,T> overridenFrom)
Input map of resources is checked - if there are matching resources inoverridenFrom
and there's no symbolic name matching, resource for original URI is restored.
-
-
-
Field Detail
-
OVERRIDE_RANGE
public static final String OVERRIDE_RANGE
- See Also:
- Constant Field Values
-
-
Method Detail
-
override
@Deprecated public static <T extends org.osgi.resource.Resource> void override(Map<String,T> resources, Collection<String> overrides)
Deprecated.Compute a list of bundles to install, taking into account overrides
.The file containing the overrides will be loaded from the given url. Blank lines and lines starting with a '#' will be ignored, all other lines are considered as urls to override bundles.
The list of resources to resolve will be scanned and for each bundle, if a bundle override matches that resource, it will be used instead.
Matching is done on bundle symbolic name (they have to be the same) and version (the bundle override version needs to be greater than the resource to be resolved, and less than the next minor version. A range directive can be added to the override url in which case, the matching will succeed if the resource to be resolved is within the given range.
- Type Parameters:
T
- the resource type.- Parameters:
resources
- the list of resources to resolveoverrides
- list of bundle overrides
-
override
public static <T extends org.osgi.resource.Resource> void override(Map<String,T> resources, Map<String,T> overridenFrom)
Input map of resources is checked - if there are matching resources in
overridenFrom
and there's no symbolic name matching, resource for original URI is restored. Effectively this method revertsmaven
override mode if there's no symbolic name matching.About versions - with previous
${karaf.etc}/overrides.properties
both symbolic name should match and versions should be compatible - either using implicit rules or by means ofrange
clause. With new mechanism, we know we should use OSGi or Maven override, but we loose information about OSGi version range matching - we assume then that version rules were applied at features JAXB model processing time.- Type Parameters:
T
-- Parameters:
resources
-overridenFrom
-
-
-