Modules
A module is a library with its own life cycle. By default, a module is started at the start of WildFly and stopped at the stop of WildFly. A module is loaded in a lazy mode only when it is required by an application.
WildFly loads the dependencies with the following priorities:
- Libraries inside the application
- Modules
- Libraries inside other external applications
JBoss module 1.5.2.Final is the product managing the modules in WildFly. All WildFly dependencies are modules, and they are situated in the modules/system/layers/base
folder. Now, let's see an example of a module representing hibernate.
From the modules
folder, there is the org/hibernate/5.0/module.xml
descriptor file. The following is the content to transform the hibernate library into a module:
<module-alias xmlns="urn:jboss:module:1.3" name="org.hibernate" slot="5.0" target-name="org.hibernate"/>
This code says that all Java packages starting with the target-name
as "org.hibernate"
will be part of the newly created org...