WildFly Modules: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 43: Line 43:


=Inter-Module Dependencies=
=Inter-Module Dependencies=
==Automatic Dependencies==
Some dependencies on modules defined by the application server are set up automatically for JEE deployments. An obvious example is JEE APIs.


==Expressing a Dependency on a Dynamic Module==
==Expressing a Dependency on a Dynamic Module==

Revision as of 19:55, 10 March 2016




Migrating from https://home.feodorov.com:9443/wiki/Wiki.jsp?page=JBossModules


External

Internal

Overview

A WildFly module (or JBoss module) is a packaged collection of classes and other resources, along with the specification of what is imported and exported by this module from and to other modules. Each API or service provided by WildFly is implemented as a module, which is loaded or unloaded on demand.

WildFly modules provide finely grained class isolation. They hide server implementation classes from the application and only load the classes the application needs. WildFly modules are peers that remain isolated unless explicitly defined as a dependency of another module. Visibility rules have sensible defaults and can be customized.

JEE deployments are also modules, which do not have access to application server modules' classes, unless an explicit dependency on those classes is defined.

For more details on class loading see WildFly class loading.

Deployment Module Names

Each JEE deployment triggers run-time initialization of corresponding module or set of modules.

A top-level deployment that does not have any other sub-deployments creates a single module named deployment.<my-archive-name>.war:<version>.

Example for a simple servlet deployment:

deployment.servlet-example.war:main

Sub-deployments are named according to the following pattern: deployment.<my-ear-archive-name>.ear.<my-war-archive-name>.war.

Inter-Module Dependencies

Automatic Dependencies

Some dependencies on modules defined by the application server are set up automatically for JEE deployments. An obvious example is JEE APIs.


Expressing a Dependency on a Dynamic Module

It is possible for a deployment to import classes - declare a dependency - on another deployment, using the other deployment's dynamic module name.

Writing a Custom WildFly Module

Writing a Custom WildFly Module

TODO

Next, continue migrating https://home.feodorov.com:9443/wiki/Wiki.jsp?page=JBossModules

Organizatorium

Upon the first use of the module, JBoss creates a <module-name>.jar.index file containing a list of packages? directories? .... .

Implicit module dependencies for deployments: https://docs.jboss.org/author/display/AS7/Implicit+module+dependencies+for+deployments