Java Reference
In-Depth Information
WildFly CDI implementation
Weld is the CDI Reference Implementation that originated as part of the Seam 3 project
( http://www.seamframework.org/ ). Weld provides a complete CDI implementation, which
can be a part of a Java EE 7 container such as WildFly.
Therefore, in order to run CDI-based applications on WildFly, you don't need to download
any extra libraries as Weld is part of the server modules, and it is included in all server con-
figurations as stated by the following extension:
<extension module="org.jboss.as.weld"/>
Having your module installed, however, does not mean that you can blindly use it in your
applications. The general rule is that on WildFly, every application module is isolated from
other modules; this means, by default, it does not have visibility on the AS modules, nor do
the AS modules have visibility on the application.
To be accurate, we could state that all WildFly modules fall into the following three cat-
egories:
Modules that are implicitly added to your applications : This category includes
the most common APIs such as javax.activation , javax.annotation ,
javax.security , javax.transaction , javax.jms , and javax.xml .
Using these modules does not require any extra effort as WildFly will add them for
you if you are referencing them in your application.
Modules that are added on conditions : This category includes javax.ejb ,
org.jboss.resteasy and org.hibernate , org.jboss.as.web , and
finally org.jboss.as.weld . All these modules will be added on the condition
that you supply its core annotations (such as @Stateless for EJB) or its core
configuration files, for example, web.xml for a web application.
Modules that need to be explicitly enabled by the application deployer : This
includes all other modules, such as your custom modules, that you can add to the
application server. The simplest way to allow you to have visibility to these mod-
ules is adding an explicit dependency to your META-INF/MANIFEST.MF file.
For example, if you want to trigger the log4j dependency, you have to code your
manifest file as follows:
Dependencies: org.apache.log4j
Search WWH ::




Custom Search