27. ClassLoader: Every Module has it's own classloader. It can only load classes from other Modules if it has declared a dependency. Loading is then delegated to the other modules ClassLoader
30. ClassLoader: Every Module has it's own classloader. It can only load classes from other Modules if it has declared a dependency. Loading is then delegated to the other modules ClassLoader
84. Project Netigso Runtime: When a bundle is available, launch embedded felix: configMap.put("felix.cache.profiledir", cache); configMap.put("felix.cache.dir", cache); configMap.put(Constants.FRAMEWORK_STORAGE, cache); activator = new NetigsoActivator(); // listen to changes List<BundleActivator> activators = new ArrayList<BundleActivator>(); activators.add(activator); configMap.put("felix.systembundle.activators", activators); felix = new Felix(configMap); felix.init();
85. Project Netigso Expose all Modules as bundles to felix: private static final InputStream fakeBundle(Module m) throws IOException { // create in memory jar containing manifest for OSGi container ByteArrayOutputStream os = new ByteArrayOutputStream(); Manifest man = new Manifest(); man.getMainAttributes().putValue("Manifest-Version", "1.0"); man.getMainAttributes().putValue("Bundle-ManifestVersion", "2"); .... JarOutputStream jos = new JarOutputStream(os, man); jos.close(); return new ByteArrayInputStream(os.toByteArray()); } // later inject the Module ClassLoader into the Bundle
86. Project Netigso Expose all Bundles as Modules to Module system: final class NetigsoModule extends Module { final Bundle bundle; private NetigsoLoader loader; ... @Override public String getCodeName() { return bundle.getSymbolicName(); } @Override public String getCodeNameBase() { return bundle.getSymbolicName(); } ...