Class BundleRegistry
java.lang.Object
de.uni_hildesheim.sse.easy.loader.framework.BundleRegistry
A registry of created bundle information objects supporting the resolution of bundles.
- Author:
- Holger Eichelberger
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<String, List<BundleInfo>> private booleanprivate static BundleRegistryprivate BundleRegistry -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCreates the root bundle registry.BundleRegistry(BundleRegistry parent) Creates a delegating bundle registry which asksparentif bundles cannot be found. -
Method Summary
Modifier and TypeMethodDescription(package private) voidadd(BundleInfo info) Adds a bundle information object to this registry.static voidaddGlobalIgnore(String name) Adds a symbolic bundle name to the global ignore list.private static StringcollectVersions(List<BundleInfo> infos) Collects the version information frominfos.get(String name, EasyDependency versionSpec) Returns a bundle information instance with the specifiedname.Returns all bundles known to this registry.private List<BundleInfo> getInfoSafe(String name) Returns the list of bundles with the samename.static BundleRegistryReturns the current instance of this registry.Returns the root bundles, i.e., those without required bundles.Returns currently unresolved bundles, i.e., those without resolving JAR file.(package private) booleanignoreBundle(String name) Returns whether the given bundle shall be ignored.voidsetEmitIgoredWarnings(boolean emit) Defines whether ignored warnings shall be emitted.static voidsetInstance(BundleRegistry registry) Redefines the current bundle registry.
-
Field Details
-
IGNORE
-
instance
-
emitIgoredWarnings
private boolean emitIgoredWarnings -
bundles
-
parent
-
-
Constructor Details
-
BundleRegistry
private BundleRegistry()Creates the root bundle registry. -
BundleRegistry
Creates a delegating bundle registry which asksparentif bundles cannot be found.- Parameters:
parent- the parent registry
-
-
Method Details
-
addGlobalIgnore
Adds a symbolic bundle name to the global ignore list.- Parameters:
name- the name of the bundle (null will be ignored)
-
getInstance
Returns the current instance of this registry.- Returns:
- the current instance
-
setInstance
Redefines the current bundle registry.- Parameters:
registry- the current registry (null will be ignored)
-
ignoreBundle
Returns whether the given bundle shall be ignored.- Parameters:
name- the name of the bundle- Returns:
trueif it shall be ignored,falseelse
-
setEmitIgoredWarnings
public void setEmitIgoredWarnings(boolean emit) Defines whether ignored warnings shall be emitted.- Parameters:
emit-trueif these warnings are emitted,falseelse
-
add
Adds a bundle information object to this registry.- Parameters:
info- the information object
-
collectVersions
Collects the version information frominfos.- Parameters:
infos- the information instances to be considered- Returns:
- the version information as String
-
getInfoSafe
Returns the list of bundles with the samename.- Parameters:
name- the symbolic bundle name- Returns:
- the list of bundles (created and hooked in if required)
-
get
Returns a bundle information instance with the specifiedname. If multiple bundle versions for the same name are registered, the first is returned (version specification is currently not supported).- Parameters:
name- the symbolic nameversionSpec- the version specification (currently not considered in resolution, just stored)- Returns:
- the related bundle information object, resolved or unresolved or null if not found
-
getAllBundles
Returns all bundles known to this registry.- Returns:
- all bundles
-
getRootBundles
Returns the root bundles, i.e., those without required bundles.- Returns:
- the root bundles (may be empty)
-
getUnresolvedBundles
Returns currently unresolved bundles, i.e., those without resolving JAR file.- Returns:
- the unresolved bundles (may be empty)
-