| |   |
| 153 | 153 | public int load; |
| 154 | 154 | public DeploymentSpec spec; |
| 155 | 155 | public boolean loaded; |
| public boolean isOsgi; |
| 156 | 157 | } |
| 157 | 158 | |
| 158 | 159 | private static class DeploymentSpec { |
| … | … | |
| 393 | 393 | unpackDeploymentSpec(url, jarName); |
| 394 | 394 | ++count; |
| 395 | 395 | } |
| } else if( url.getProtocol().equals("bundleresource") ) { |
| String eform = url.toExternalForm(); |
|
| // Try to decide the name of the .jar file to have a |
| // reference point for later.. |
| int end = eform.length() - DEPLOY_DESCRIPTOR_NAME.length() - 2; |
| int start = eform.lastIndexOf('/', end - 1) + 1; |
|
| if (start > 0 && start < end) { |
| String jarName = eform.substring(start, end); |
| if (VERBOSE_LOADING) |
| reporter.report("Loading ", jarName, " from ", eform); |
| |
| unpackDeploymentSpecOSGi(url,jarName); |
| ++count; |
| } |
| |
| 396 | 413 | } |
| 397 | 414 | } |
| 398 | 415 | |
| … | … | |
| 472 | 472 | } |
| 473 | 473 | |
| 474 | 474 | reporter.report(" - using deployment spec"); |
| File libFile = new File(jambiTempDirBase(e.spec.key), e.name); |
| Runtime.getRuntime().load(libFile.getAbsolutePath()); |
| if( ! e.isOsgi ) { |
| File libFile = new File(jambiTempDirBase(e.spec.key), e.name); |
| Runtime.getRuntime().load(libFile.getAbsolutePath()); |
| } else { |
| System.loadLibrary(new File(e.name).getName()); |
| } |
| 477 | 481 | reporter.report(" - ok!"); |
| 478 | 482 | e.loaded = true; |
| 479 | 483 | |
| … | … | |
| 539 | 539 | } |
| 540 | 540 | } |
| 541 | 541 | |
|
| private static void unpackDeploymentSpecOSGi(URL deploymentSpec, String jarName) throws Exception { |
| DeploymentSpec spec = readDeploySpec(deploymentSpec, jarName); |
| |
| if( spec == null ) |
| return; |
| |
| for (LibraryEntry e : spec.libraries) { |
| e.isOsgi=true; |
| } |
| } |
| |
| 543 | 553 | private static void unpackDeploymentSpec(URL deploymentSpec, String jarName) throws Exception { |
| 544 | 554 | reporter.report("Unpacking .jar file: '", jarName, "'"); |
| 545 | 555 | |