public interface JSModule extends JSResolvableBundleAsset
JSBundle
.
JSModule
s belong to a JSPackage
and JSPackage
s belong
to a JSBundle
.
You can have several copies of the same JSModule
in different
modules of the portal. For example, suppose you have a module named
p@1.0.0/m
(the module m
residing in package
p
with version 1.0.0) containing three OSGi bundles:
b1.jar
, b2.jar
, and b3.jar
. In this
scenario, you would have three JS modules in the NPMRegistry
(one per
bundle) and one JS resolved module (depending on the algorithm used, points
to one of the three JS modules). The JS module is served to the browser using
its JS resolved module (i.e., a virtual entity passed to the browser to avoid
using any of the other three JS modules).
The modules would look something like this:
Modules:b1.jar:p@1.0.0/m
with URL .../b1.jar/p@1.0.0/m
b2.jar:p@1.0.0/m
with URL .../b2.jar/p@1.0.0/m
b3.jar:p@1.0.0/m
with URL .../b3.jar/p@1.0.0/m
p@1.0.0/m
with URL .../p@1.0.0/m
The URL of the resolved module does not show any reference to a bundle. Also,
when the resolved module is requested, it's internally resolved to one of the
other three modules. Therefore, the requester would receive something like
.../b2.jar/p@1.0.0/m
, but wouldn't notice it since it's
transparent to the requester.
Modifier and Type | Method and Description |
---|---|
java.util.Collection<java.lang.String> |
getDependencies()
Returns the module dependencies declared by the NPM module.
|
java.util.Collection<java.lang.String> |
getDependencyPackageNames()
Returns the packages that contain all the NPM module's dependencies.
|
JSPackage |
getJSPackage()
Returns the module's NPM package.
|
java.io.InputStream |
getSourceMapInputStream()
Returns the module's source map.
|
getResolvedId, getResolvedURL
getInputStream, getURL
getId, getName
java.util.Collection<java.lang.String> getDependencies()
java.util.Collection<java.lang.String> getDependencyPackageNames()
JSPackage getJSPackage()
java.io.InputStream getSourceMapInputStream() throws java.io.IOException
InputStream
that allows reading the bytes inside the
source mapjava.io.IOException
- if an IO exception occurred