public class ModuleUtils extends Object
| Constructor and Description |
|---|
ModuleUtils() |
| Modifier and Type | Method and Description |
|---|---|
static InputStream |
addModuleDependencies(InputStream sourceStream)
Performs the transformation of the capability attributes in the MANIFEST.MF file of the supplied stream.
|
static ModuleManager |
getModuleManager()
Retrieves an instance of the module manager.
|
static org.springframework.core.io.Resource |
loadBundleResource(org.osgi.framework.Bundle bundle)
Load the bundle .jar resource.
|
static PersistentBundle |
loadPersistentBundle(String bundleKey)
Returns the persistent bundle info for the specified key.
|
static PersistentBundle |
persist(org.osgi.framework.Bundle bundle)
Performs the persistence of the supplied bundle and returns the information about it.
|
static PersistentBundle |
persist(org.springframework.core.io.Resource bundleResource)
Performs the persistence of the supplied bundle resource and returns the information about it.
|
static boolean |
requiresTransformation(Attributes atts)
Checks if the artifact manifest requires adjustments in the capability headers w.r.t.
|
static void |
updateBundleLocation(org.osgi.framework.Bundle bundle,
String updatedLocation)
Performs the update of the bundle original location.
|
public static InputStream addModuleDependencies(InputStream sourceStream) throws IOException
sourceStream - the source stream for the bundle, which manifest has to be adjusted w.r.t. module dependencies; the stream is
closed after returning from this methodIOException - in case of I/O errorspublic static ModuleManager getModuleManager()
public static org.springframework.core.io.Resource loadBundleResource(org.osgi.framework.Bundle bundle)
throws MalformedURLException
bundle - the bundle to be loadedMalformedURLExceptionpublic static PersistentBundle loadPersistentBundle(String bundleKey) throws ModuleManagementException
bundleKey - the key of the bundle to look upModuleManagementException - in case of a lookup errorpublic static PersistentBundle persist(org.osgi.framework.Bundle bundle) throws ModuleManagementException
bundle - the source bundleModuleManagementException - in case of an error during persistence of the bundlepublic static PersistentBundle persist(org.springframework.core.io.Resource bundleResource) throws ModuleManagementException
bundleResource - the source bundle resourceModuleManagementException - in case of an error during persistence of the bundlepublic static boolean requiresTransformation(Attributes atts)
atts - the manifest attributes to be checkedtrue if the artifact manifest requires adjustments in the capability headers w.r.t. module dependencies;
false if it already contains that infopublic static void updateBundleLocation(org.osgi.framework.Bundle bundle,
String updatedLocation)
bundle - the bundle to update location forupdatedLocation - the new value of the locationCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.