Java Reference
In-Depth Information
in the EJB-JAR module, the beans will run in a full EJB container. When packaged inside
a WAR module, the beans will run in an EJB Lite container, which has most but not all
of the features of a full EJB container. We'll now look at packaging EJB-JAR and WAR
modules, comment on the pros and cons of deployment descriptors versus annotations, and
then finish by looking at configuring default interceptors.
13.3.1. Packaging EJB-JAR
An EJB-JAR module is really nothing more than a Java JAR archive. With Java EE's em-
phasis on convention-over-configuration and its use of annotations, the EJB-JAR module
doesn't even need to include the META-INF/ejb-jar.xml deployment descriptor. When the
EE server deploys an EAR, it'll automatically scan through the JAR and look for either
EJB 3 annotations or the META-INF/ejb.jar.xml file to determine if the JAR is an EJB-JAR
module (refer back to section 13.1.2 for more information on this scanning process). So to
create an EJB-JAR module, create a normal Java JAR archive with the following structure:
How you create this JAR file is really a question of what technology you're using. For Java
development, there are a lot of options when it comes to technology, so there's something
out there to fit your needs. Let's explore options using NetBeans and Maven.
NetBeans
Using NetBeans, create a new EJB module and add the source code for your session and
message-driven beans. Figure 13.4 shows what the Projects tab view of the module may
look like.
Search WWH ::




Custom Search