Constructor and Description |
---|
OSGiURLPolicy(Oscar oscar) |
Modifier and Type | Method and Description |
---|---|
java.net.URL |
createCodeSourceURL(ModuleManager mgr,
Module module)
This method should return a URL that represents the
location from which the module originated.
|
java.net.URL |
createResourceURL(ModuleManager mgr,
Module module,
int rsIdx,
java.lang.String name)
This method should return a URL that is suitable
for accessing the bytes of the specified resource.
|
public OSGiURLPolicy(Oscar oscar)
public java.net.URL createCodeSourceURL(ModuleManager mgr, Module module)
URLPolicy
This method should return a URL that represents the location from which the module originated. This URL can be used when assigning permissions to the module, such as is done in the Java permissions policy file.
createCodeSourceURL
in interface URLPolicy
mgr
- the ModuleManager of the module.module
- the module for which the URL is to be created.public java.net.URL createResourceURL(ModuleManager mgr, Module module, int rsIdx, java.lang.String name)
URLPolicy
This method should return a URL that is suitable for accessing the bytes of the specified resource. It must be possible open a connection to this URL, which may require that the implementer of this method also introduce a custom java.net.URLStreamHander when creating the URL.
createResourceURL
in interface URLPolicy
mgr
- the ModuleManager of the module.module
- the module for which the resource is being loaded.rsIdx
- the index of the ResourceSource containing the resource.name
- the name of the resource being loaded.