Java Reference
In-Depth Information
module, require a deployment descriptor (see section 13.3.5 ) . An EJB-JAR module may
contain
• A deployment descriptor (ejb-jar.xml)
• A vendor-specific deployment descriptor, which is required to perform certain con-
figuration settings in a particular EJB container
The good news is that you can mix and match annotations with descriptors by specifying
some settings in annotations and others in the deployment descriptor. Be aware that the de-
ployment descriptor is the final source and overrides settings provided through metadata
annotations. To clarify, you could set the TransactionAttribute for an EJB method
as REQUIRES_NEW using an annotation, and if you set it to REQUIRED in the deployment
descriptor, the final effect will be REQUIRED .
Nonstandard deployment descriptors
In addition to the standard deployment descriptor (ejb-jar.xml), most application servers
also have extensions that provide application server-specific configuration options. For ex-
ample, GlassFish has the glassfish-ejb-jar.xml file and WebLogic has weblogic-ejb-jar.xml.
It's important to remember that these aren't part of the Java EE specification standards.
They'll work only on their respective application servers. These application-specific con-
figuration files usually give you direct access to features of the server that are nonstandard
and extend the default behavior of an EE server in some way. Although these extensions
are sometimes useful, they make your application less portable between servers. In some
cases, portability may become impossible.
Let's look at some quick examples to see what deployment descriptors look like so that you
can package a deployment descriptor in your EJB module if you need to. The following
listing shows a simple example of a deployment descriptor for the Bazaar-Admin EJB.
Search WWH ::




Custom Search