private Bundle getBundle(String bundleName) { Bundle bundle = bundles.get(bundleName); if (bundle == null) { /* NativeLibrary.addSearchPath(bundleName, "."); String module_path = System.getenv("GSP_MODULES_PATH"); if (module_path != null && !module_path.isEmpty()) { String delims = ":"; String[] tokens = module_path.split(delims); for (int i = 0; i < tokens.length; i++) { if(!tokens[i].isEmpty()) NativeLibrary.addSearchPath(bundleName, tokens[i]); } } module_path = System.getProperty("gsp.module.path"); if (module_path != null && !module_path.isEmpty()) { String delims = ":"; String[] tokens = module_path.split(delims); for (int i = 0; i < tokens.length; i++) { if(!tokens[i].isEmpty()) System.err.println("ADDED "+tokens[i]); NativeLibrary.addSearchPath(bundleName, tokens[i]); } } try { bundle = new Bundle(NativeLibrary.getInstance(bundleName), NativeFunctionFinder.create(bundleName)); bundles.put(bundleName, bundle); } catch (Exception e) { // TODO test NativeFunctionFinder also (add exceptions in it, or in the create or ...) // cannot load // TODO report }*/ try { bundle = new Bundle(BridJ.getNativeLibrary(bundleName), NativeFunctionFinder.create(bundleName)); bundles.put(bundleName, bundle); // bundle.jnalibrary = NativeLibrary.getInstance(bundleName); } catch (Exception e) { throw ex("Could not load native bundle/library with name '" + bundleName + "'", e); // TODO test NativeFunctionFinder also (add exceptions in it, or in the create or ...) // cannot load // TODO report } } return bundle; }