To manage the modules from a console for example, JMX is the appropriate solution in the java world.
Java Management Extensions (JMX) is a Java technology that supplies tools for managing and monitoring applications, system objects, devices (e. g. printers) and service oriented networks. Those resources are represented by objects called MBeans (for Managed Bean). In the API, classes can be dynamically loaded and instantiated. Managing and monitoring applications can be designed and developed using the Java Dynamic Management Kit.
JBoss-modules conatins the package org.jboss.modules.management which contains the ModuleLoaderMXBean, this interface defines methods to get all interesting infos for a module, and we can also unload the module.
This interface is implemented by the org.jboss.modules.ModuleLoader.MXBeanImpl class.
JBoss Modules is a standalone implementation of a modular (non-hierarchical) class loading and execution environment for Java. In other words, rather than a single class loader which loads all JARs into a flat class path, each library becomes a module which only links against the exact modules it depends on, and nothing more. It implements a thread-safe, fast, and highly concurrent delegating class loader model.
Thanks to lahlali issam for providing the material for this tutorial. You can evaluate a free copy of JArchitect here.
- << Prev