You are on page 1of 30

Finally, don’t forget to do a lot of mock exams.

Head First EJB contains a lot of


JavaBlackBelt’s example questions, and on JavaRanch you can find links to other sites. This
gives you an idea about the kind of questions you can expect, and identify the

SCBCD Study Guide


sections that require some more studying to be fully prepared. For example, I
know from my teaching experience that the questions about role-responsibilities
can be harder than expected when reading the theory.

2 Author
1 Introduction Liesbeth Jaco is a Java instructor at Loop Factory,
1.1 Why this document? Belgium. She moderates the EJB and WebSphere
sections at JavaBlackBelt.com.
Together with the “Head First EJB” book and the Sun EJB version 2.0
Specification, this study guide should help you to become fully prepared for the
SCBCD certification exam. She will be happy to get your feedback about this
document by email: Liesbeth <at} JavaBlackBelt dot com

+ + +

3 Reviewers
This study guide has been kindly reviewed by …
The basis of this document was written when I studied for the SCBCD Valentin Crettaz has a Masters degree in Information and Computer
Science from the Swiss Federal Institute of Technology in Lausanne
certification myself. I felt that next to the clear explanations of “Head First EJB”, (EPFL). He has worked as a software engineer with SRI International
the summarizing bullet points, recap exercises and mock questions, I needed a (Menlo Park, CA) and as a principal engineer in the Software
more concise, structured document to allow me to have an overview and have a Engineering Laboratory of EPFL.
quick, last-minute check of some difficult sections. Kind of like Valentin Crettaz’s Valentin is the co-founder and CTO of Condris Technologies, a
cheat sheets I found on JavaRanch. Other “summaries” were sometimes too company specializing in the development of next generation software
wordy and elaborate, and not structured enough to serve as a real study guide. architecture solutions.
Recently, I taught a class of students with the purpose of obtaining the EJB His research and development interests include aspect-oriented
certification. As I used “Head First EJB” in my course material, I got the same technologies, design and architectural patterns, web services, and software architecture.
remarks from the students about it as I made myself, which encouraged me to During his spare-time, Valentin moderates the SCBCD and SCDJWS forums at
Javaranch.com and acts as a technical reviewer for O'Reilly's Head First series. He holds
transform my personal notes into this complete studyguide.
various Sun and IBM certifications, such as SCJP, SCJD, SCBCD, SCWCD, SCDJWS and
IBM XML. He has also had the great opportunity to serve as a co-author for Whizlabs'
1.2 How to use it? SCBCD and SCDJWS Exam Simulators.
As introduced, this document should not be used as a standalone study guide. John Rizzo is cofounder and managing director of Loop Factory, a Java
First of all, I assume that you already have an understanding of EJB - by reading focused education company.
“Head First EJB” or a similar book. Secondly, I often refer to the HF book, e.g. He has spent the last decade teaching IT; from OO to Java, going
for a concrete example, for additional theory that was not easy to summarize, or through AS/400 systems, methodologies and Delphi; to professionals,
when the book contains a nice structured summary anyway. So the purpose of unemployed and children.
these notes is not to replace this book, but to be a guide-book. John has co-founded JavaBlackBelt.com, a web site dedicated to
technical quizzes about Java related technologies.

JavaBlackBelt’s SCBCD Study Guide page 1


4 Bibliography
• Head First EJB (Brain-Friendly Study Guide) by Kathy Sierra and Bert Bates
(referred to as [HFEjb])
• Sun Microsystems Enterprise JavaBeans Specification, Version 2.0
(referred to as [EjbSpec])
• http://www.valoxo.ch/jr/cheatsheets.html: Cheat sheets and spec-to-
objectives mapping (See e.g. appendix DD Schema)
• http://www.valoxo.ch/jr/SCBCD_Links.html: JavaRanch links to objectives,
mock exams, …
• http://www.javaworld.com/jw-10-1998/jw-10-beans-p3.html: introductory
article

JavaBlackBelt’s SCBCD Study Guide page 2



EJB Overview and Architecture •
Do not create or get classloader
Do not access security policy info
• Do not load native library
• Do not pass this (bean instance) as argument or method result, only
1 Use, Benefits, and Characteristics of EJBs component interface
• Have an overall understanding of how EJBs work, what they are good for, what • Some others and reason: page 494 [EjbSpec]
they provide and what they don’t provide. Know the architecture and how it So, you’re allowed to use: java.net.Socket, inheritance for bean classes,
supports EJB features. final static fields.
• Described in [HFEjb], especially chapters one to three.
4 EJB Roles with Responsibilities
2 Container Requirements • Roles: Bean Provider, Application Assembler, Deployer,
2.1 Guaranteed APIs Container and Server Provider, System Administrator
EJB 2.0, J2SE 1.3, JNDI, JTA, JDBC 2.0, JMS, JavaMail, JAXP • Responsibilities:
- Description: page 26 [HFEjb]
2.2 Guaranteed Services and Behavior - Must be able to match a role with a responsibility description, or
Example list (not exhaustive): deployment descriptor (DD) tags
• Distributed transaction o Pages 617-619 [HFEjb]
• Thread-safety o see DD Schema
• A security domain and one principal realm
• Enforcement of client access security policies
5 Requirements for an EJB-jar File
• [NameToChoose].jar
• Implementation of java:comp/env for bean
- META-INF
• Generation of implementation classes of home and component interface,
and stubs for remote object - ejb-jar.xml
- <directory-structure-matching-package>
• Implementation of resource manager connection factory classes for
resources configured with the server - home interfaces (session + entity)
• Others: described throughout the [EjbSpec] under “Responsibilities of - component interfaces (session + entity)
Container Provider” sections (7.11, 10.7, 15.8). - bean classes (session + entity + message driven)
So the following are NOT guaranteed: clustering, load-balancing, fault-tolerance, - primary key class (entity bean)
lazy-loading of entity data, in-memory data caching, … - non J2SE/J2EE classes/interfaces that any of the above depend
on
3 EJB Programming Restrictions • Forbidden: Container generated classes (implementation classes home and
Restrictions for business methods to ensure portability and avoid deployment component interface, stubs for remote objects)
errors: • Optional: Manifest file (usage: page 487 [EjbSpec], point 23.3)
• Do not read/write static fields
• Do not use synchronization and threads
• Do not use AWT to output or get keyboard input
• Do not use java.io
• Do not use ServerSocket

JavaBlackBelt’s SCBCD Study Guide page 3


• IsIdentical()
Client View • find out whether two stubs refer to the same bean:
- stateless SB: true if stubs came from same home
- stateful SB: always false
1 Client View of Beans - EB: true if stubs refer to two entities with the same PK
• Description in [EjbSpec] …. • page 142 [HFEjb]

Session Entity
Message 4 Interfaces to Memorize
Driven
See Interfaces Schema for the methods of following interfaces
Remote You must know when certain methods cannot be called!
page 58, 6.3 page 111, 9.5
EJBHome • EJBHome
Home interface
Local - remove(Object PK) for SB: RemoveException
page 60, 6.4 page 114 , 9.6
EJBLocalHome • EJBLocalHome
Remote - remove(Object PK) for SB: RemoveException
page 121, 9.9
Component EJBObject • EJBObject
page 61, 6.5
interface Local
page 122, 9.10 - getPrimaryKey() for SB: RemoteException
EJBLocalObject • EJBLocalObject
• Memorize methods: see Interfaces Schema - getPrimaryKey() for SB: EJBException

2 Client Lookup
You have to know the syntax of a lookup and must recognize whether a client is
local or remote.

2.1 Remote Home Interface


Context initialContext = new InitialContext();
Object o = initialContext.lookup("java:comp/env/ejb/cart");
CartHome cartHome =
(CartHome)javax.rmi.PortableRemoteObject.narrow(o,
CartHome.class);

2.2 Local Home Interface


Context initialContext = new InitialContext();
Object o = initialContext.lookup("java:comp/env/ejb/cart");
CartHome cartHome = (CartHome) o;

3 Handles
• Serializable representation of component or home interface, that knows how to
get back to the original Remote object (getEJBObject(), getEJBHome())
• Page 139 [HFEjb]

JavaBlackBelt’s SCBCD Study Guide page 4


• Only for stateful SB; stateless SB goes back to pool between each method call,
Session Beans since not tied to a particular client.
• Bean provider responsibility: when ejbPassivate method completes, all non-
transient instance variables must be passivatable:
1 Stateless vs Stateful - Serializable object
• Stateful: conversational state (instance fields and referenced objects) - null
• Stateless: no conversational state (state that belongs to a specific client) - component or home interface (remote or local)
- page 87 [EjbSpec], intro point 7.8 - SessionContext object
- Bean’s JNDI context (java:comp/env), or subcontext of it
2 Implementation Requirements (Bean Provider) - UserTransaction object
• Read in [HFEjb] …. - Resource manager connection factory (e.g. javax.sql.DataSource)
• Gets re-activated (container deserializes and calls ejbActivate) when client calls
Home interface Component interface Bean class business method
Home methods page 232 page 233 - Container must restore the passivatable instance variables with
functionally equivalent variables. Transient variables must not be
Business methods page 234 page 235 restored.

• Bean class (other rules) 6 Lifecycles


- page 236 [HFEjb] • See Lifecycles Schema
- summary bean class: see Bean Classes Schema • Missed ejbRemove Calls
3 Creation - When?
Crash of EJB Container
• stateless: ejbCreate not tied to client called create() (same for removal)
System Exception from bean instance
• stateful: create() calls constructors of EJBObject, SessionContext and bean
Timeout of client inactivity while bean in passive state
class, and methods setSessionContext and ejbCreate
- Consequences for automatic resource releasing: page 82 [EjbSpec],
Object interaction diagram and implementation: pages 194, 195 [HFEjb]
point 7.6.3
4 SessionContext 7 Use of SessionSynchronization Interface
• EJBContext, and additional SessionContext methods: see Interfaces Schema
• See Transactions-section
• Know what you can call under which circumstances: see WhatYouCanCall
Schema 8 Interfaces to Memorize
5 Passivation of Conversational State See Interfaces Schema: Methods of following interfaces
• SessionBean
• Stateful session beans are saved in temporary storage to save resources by
calling ejbPassivate • SessionContext
- Who calls method? Container • SessionSynchronization
- When? Client hasn’t called any method for a while and bean is not in
transaction.
- How? Using Serialization or something equivalent

JavaBlackBelt’s SCBCD Study Guide page 5


Entity Bean public CompIntfType create(params) throws CreateException,
In home interface
RemoteException;
1 Primary keys public PKType ejbCreate(params) {…}
• Unique identity: may be visible as one or more CMP fields - PK must be set
- Must be set by the end of ejbCreate - return null when CMP
- Once set, cannot be changed (else IllegalStateException)
- page 133 [EjbSpec], point 10.3.5
- only declare exceptions when thrown
public void ejbPostCreate(params) {…}
} In bean class

• Specified by Bean Provider - only declare exceptions when thrown


- Single field in EB class: <primkey-field>
- Multiple fields in EB class: define PK Class 4 Removal
Class must be public and serializable Entity deleted from underlying persistent store, entity bean goes back to pool
public constructor without parameter Comparison with Session Bean: page 282 [HFEjb]
public fields, subset of the names of the CMP fields
suitable implementation of hashCode() and equals(Object)
5 EntityContext
• EJBContext, and additional EntityContext methods: see Interfaces Schema
2 Implementation Requirements (Bean Provider) • Know what you can call under which circumstances: see WhatYouCanCall
For certif.: only those for CMP must be known! Schema
• Description in [EjbSpec]….
6 Passivation/Activation
Home interface Component interface • ejbPassivate: Entity bean has finished a business method (other than remove())
and is about to go back to the pool, where it has no identity
Local 10.6.12 10.6.11
• ejbActivate: bean is needed to service a business method from a client
Remote 10.6.10 10.6.9 • Comparison with Session Bean: page 309 [HFEjb]

• Bean class 7 Finders


- Overview: Bean Classes-Schema • Declared in home interface, nothing about them in bean class.
- General: page 190 [EjbSpec], point 10.6.2 • Can return (collection of) EJB(Local)Object of the same type as entity bean.
- Implementation rules (sections from [EjbSpec]):
• Implemented by container, using home interface and DD information (EJB-QL).
ejbCreate 10.6.4
• Mandatory: findByPrimaryKey (but this one is not declared in DD)
ejbPostCreate 10.6.5
• Object interaction diagram page 340 [HFEjb]
ejbHome 10.6.6
• [EjbSpec] point 10.5.6
ejbSelect 10.6.7
business methods 10.6.8 8 Selectors
3 Creation • Abstract method defined in the bean class, not exposed in home or component
interface
Create new entity in underlying persistent store
• Can return CMP or CMR fields
Comparison with Session Bean: page 281 [HFEjb]
• Typically used in home business method to do the real data access.
• If it returns (collection of) EJBObject, use

JavaBlackBelt’s SCBCD Study Guide page 6


<result-type-mapping>Remote</result-type-mapping> <ejb-name>bean1</ejb-name>
(default is Local) </relationship-role-source>
<cmr-field>
• Implemented by container, using DD information (EJB-QL).
<cmr-field-name>field3</cmr-field-name>
• [EjbSpec] point 10.5.7
<cmr-field-type>java.util.Collection</cmr-field-type>

9 CMP fields </cmr-field>


<cascade-delete />
• Abstract Persistent Schema: </ejb-relationship-role>
- Virtual Fields: abstract getters/setters, implemented by container <!-- similar for the other role - ->
- info in DD: </ejb-relation>
</relationships>
...
<entity> - Concrete example: pages 388-389 [HFEjb]
... • <cascade-delete />:
<abstract-schema-name>SchemaName</abstract-schema-name>
- If the bean on the other side of this relationship gets deleted, also
<cmp-field> delete this bean
<field-name>field1</field-name>
- only when other <ejb-relationship-role> element of <ejb-
<cmp-field>
relation> has multiplicity One
<cmp-field>
<field-name>field2</field-name> • Unidirectional (One-way) relationships: declare two <ejb-relationship-
<cmp-field> role> elements for this relation, but leave the <cmr-field> section out.
<primkey-field>field1</primkey-field> • Referential integrity maintained by container during assignments:
... - if multiplicity of relationship field is
</entity> One, do a move
... Many, do a copy
- Examples pages 421-422 [HFEjb]
• Example in entire Deployment Descriptor: see DD Schema
11 EJB-QL
10 CMR Fields (Relationships)
11.1 What?
• Abstract Persistent Schema:
Used by Bean Provider to write portable queries for finders and selectors.
- Virtual Fields: abstract getters/setters, implemented by container Deployer maps CMP fields to real tables and data.
Local component interface type or Collection type
(java.util.Collection/Set) 11.2 Syntax
- info in DD: • Query Domain: a single deployment descriptor
... • Possible return types:
<relationships> - Range variable: an abstract schema type for an entity bean (= the
<ejb-relation> component interface)
<ejb-relationship-role> SELECT OBJECT(m) FROM MovieSchema m
<ejb-relationship-role-name>role1</ejb-relationship-role-name>
- Single-valued path expression: a <cmp-field> single value type for
<multiplicity>Many</multiplicity>
an entity bean (not cmr field!)
<relationship-role-source>

JavaBlackBelt’s SCBCD Study Guide page 7


SELECT m.title FROM MovieSchema m
- OBJECT(m)? page 407 [HFEjb]
• Identifiers: must be valid Java identifier, not the same as an <abstract-
schema-name> or <ejb-name> from DD, and not an EJB-QL reserved
keyword. And: EJB-QL is not case-sensitive!
• Keywords: select, from, where, distinct, object, null, true, false, not, and, or,
between, like, in, as, unknown, empty, member, of, is
- Remark: unknown is reserved for future use
• String enclosed in single quotes
• Input parameters: ?1, ?2, ..
• <> is “not equals”

11.3 Examples
… which show the use of following keywords…
• SELECT and FROM: mandatory
- Page 409 [HFEjb]
- DISTINCT: returned Collection contains no duplicates
• WHERE: pages 411-412 [HFEjb]
• IN: pages 415 + 417 [HFEjb]
• BETWEEN: page 416 [HFEjb]
- Inclusive, NOT BETWEEN is exclusive!
• IS EMPTY, NOT EMPTY page 418 [HFEjb]
• LIKE, NOT LIKE page 419 [HFEjb]

12 Lifecycles
See Lifecycles Schema

13 Interfaces to Memorize
See Interfaces Schema: Methods of following interfaces
• EntityBean
• EntityContext

JavaBlackBelt’s SCBCD Study Guide page 8


Message Driven Bean
1 Implementation Requirements (Bean Provider)
• Overview: Bean Classes Schema
• Rules: page 448 [HFEjb]

2 Message Acknowledgment
See Transactions-section

3 MessageDrivenContext
• Methods from EJBContext interface, no additional methods in
MessageDrivenContext: see Interfaces Schema
• Know what you can call under which circumstances: see WhatyouCanCall
Schema

4 Lifecycle
See Lifecycles Schema

5 Interfaces to Memorize
See Interfaces Schema: Methods of following interface
• MessageDrivenBean
• javax.jms.MessageListener

JavaBlackBelt’s SCBCD Study Guide page 9


Transactions 3 CMT
• Only possibility for EB
1 CMT vs BMT • Memorize transaction attributes
• CMT: declare transactions in DD - See Transactions-Summary
• BMT: code transactions in bean - figure out combinations, genre page 496 [HFEjb]
- MDB: only Required or NotSupported
• In Deployment Descriptor: declare what type of transactions you will use (Bean
Provider) • Memorize (see Transactions-Summary):
- <transaction-type>Container|Bean</transaction-type> - Which methods must be marked?
- Do not mix CMT and BMT! - Which methods can run in “unspecified tx context”?
- Example in entire Deployment Descriptor: see DD Schema • Only system exceptions cause an automatic rollback!
• In Deployment Descriptor:
2 BMT - <assembly-descriptor> section, by Application Assembler
• Only for MDB and SB - by wildcard (1) or named methods (2) [with params (3)]
• Use JTA: javax.transaction.UserTransaction interface
- Memorize methods: see Interfaces Schema <!-- (1) example with wildcard-->
- Example p478 [HFEjb] <container-transaction>
• Restrictions <method>
<ejb-name>MyBean</ejb-name>
- No nested transactions: do not start a transaction before ending the
current transaction: <method-name> * </method-name>
</method>
ut.begin();
<trans-attribute>Required</trans-attribute>
//… statements, but not ut.commit()/rollback() ;
</container-transaction>
ut.begin(); //not allowed!
- only stateful SB can leave transaction open at end of method (so <!-- (2) example with individually-named method - ->
ending a transaction method without having called commit() or
<container-transaction>
rollback()) but the transaction must be completed in another business
<method>
method.
<ejb-name>MyOtherBean</ejb-name>
• BMT hurt reuse: will never use other bean’s transaction (BMT and CMT); the
<method-name>firstMethod</method-name>
caller’s transaction will be suspended.
</method>
- CMT runs in both CMT and BMT transactions
<method>
- page 482 [HFEjb] <ejb-name>MyOtherBean</ejb-name>
• Use it for things you can’t do with CMT: <method-name>secondMethod</method-name>
- Delimiting a transaction smaller than a single method </method>
- Leaving a stateful SB transaction open across multiple client <trans-attribute>Required</trans-attribute>
invocations </container-transaction>
- Separate transaction commit status of MDB from message
acknowledgment

JavaBlackBelt’s SCBCD Study Guide page 10


</acknowledge-mode>
<!-- (3) example with overloaded methods --> page 460 [HFEjb]
<container-transaction>
<method>
<ejb-name>MyOtherBean</ejb-name> 5 setRollbackOnly
<method-name>myOverloadedMethod</method-name> • Mark the transaction so that it will never commit.
<method-params> • No rollback immediately, but when the transaction ends naturally:
<method-param>int</method-param> - When method that started transaction completes (CMT)
</method-params> - When the bean’s code calls commit() or rollback() (BMT)
</method>
• Other participants of transaction can check whether transaction is already
<trans-attribute>Required</trans-attribute> doomed.
</container-transaction>
<container-transaction> 5.1 CMT
<method> • Use EJBContext
<ejb-name>MyOtherBean</ejb-name> - Setting: Call setRollbackOnly()
<method-name>myOverloadedMethod</method-name> - Checking: Call getRollbackOnly()
<method-params>
• Both methods must be called from within a transaction, so within a method
<method-param>int</method-param>
marked Required, RequiresNew or Mandatory
<method-param>java.lang.String</method-param>
</method-params> 5.2 BMT
</method> • Use UserTransaction (so lookup JTA)
<trans-attribute>Required</trans-attribute> - Setting: setRollbackOnly() (must be called from within a transaction, so
</container-transaction> between ut.begin() and ut.commit()/rollback())
- checking: call getStatus()
4 Remarks for MDB (Message Acknowledgement) 6 Session Synchronization
4.1 CMT • Only for CMT stateful session beans
• Reading message and performing business logic in one transaction • javax.ejb.SessionSynchronization interface
• If transaction rolls back, the message goes back to the original destination
After transaction
- Vendor dependent: setting a maximum on the number of times the Before transaction In transaction (commit or rollback called)
message is resent. afterBegin Business beforeCompletion afterCompletion
method (boolean hasCommitted)
4.2 BMT: What can you call? SessionContext: everything like CMT SB From SessionContext: no
• transaction begins after bean receives message Access java:comp/env, resource managers, other transaction related things.
• If the method throws a runtime exception, message goes back to the original beans Access only java:comp/env
destination
• use DD to specify how the Container sends acknowledgement to messaging - Use? See page 512 [HFEjb]
service: - Memorize methods: see Interfaces Schema
<acknowledge-mode>
Auto-acknowledge|Dups-ok-acknowledge

JavaBlackBelt’s SCBCD Study Guide page 11


Exceptions
1 Application vs. System Exceptions
1.1 See Exceptions-Summary appendix
1.2 Standard EJB Application Exceptions
• API: see Exceptions-Summary
• Stateless SB: never RemoveException
• When thrown and client’s point of view: pages 548-549 [HFEjb]

1.3 Common System Exceptions


• API: see Exceptions-Summary
• When thrown? page 552 [HFEjb]

2 Responsibilities
2.1 Bean provider responsibilities
• If you catch or create an application exception, throw it to container as
application exception
- If you find you can’t continue transaction, call setRollbackOnly() first
• If business logic throws an exception the client does not expect, catch it and
rethrow it as EJBException
• Don’t catch runtime exception in business logic, just propagate it
• Application exception must be declared in client interface and bean class
• When creating own application exceptions: extend Exception
- NOT RuntimeException or RemoteException

2.2 Container responsibilities


[HFEjb] p546
• Send application exception as is, and don’t rollback
• If system exception
- RemoteException or EJBException
- Log exception
- Rollback transaction
- Kill bean

3 Scenarios
Read example scenarios: pages 558-560 [HFEjb]

JavaBlackBelt’s SCBCD Study Guide page 12


<role-name>Director</role-name>
Security <!-- (3) By name and arguments -->
<method>
1 Declarative Security: Class-Level <ejb-name>MyBean</ejb-name>
<method-name>methodTwo</method-name>
1.1 Bean Provider: do nothing <method-params>
<method-param>String</method-param>
1.2 Application Assembler
</method-params>
• Define roles in DD: </method>

<assembly-descriptor> <!-- (4) By name and interface (Remote/Home/Local/LocalHome) -->


<security-role> <method>
<description>this role is for employees who ....</description> <ejb-name>MyBean</ejb-name>
<role-name>Admin</role-name> <method-intf>Remote</method-intf>
</security-role> <method-name>methodOne</method-name>
<security-role> </method>
<description>this role is for employees who ....</description> </method-permission>
<role-name>Director</role-name>
</security-role> <method-permission>
... <unchecked/>
</assembly-descriptor> <method>
<ejb-name>MyOtherBean</ejb-name>
• Assign method permissions in DD: <method-name>methodTwo</ejb-name>
- Method permissions interact as a union </method>
- <unchecked />: method free for everyone to call </method-permission>
</assembly-descriptor>
<assembly-descriptor>
<method-permission>
1.3 Deployer
<role-name>Admin</role-name>
<!-- (1) By wildcard --> • Assign security domain and principal realm to the application
<method> • Map users and/or groups to abstract security roles
<ejb-name>MyBean</ejb-name> See page 583 [HFEjb]
<method-name>*</method-name>
</method>
2 Programmatic Security: Instance-Level
<!-- (2) By name-->
<ejb-name>MyOtherBean</ejb-name>
2.1 Bean Provider: Use EJBContext
<method-name>methodOne</method-name> • java.security.Principal p = context.getCallerPrincipal()
</method-permission> - p.getName(): not guaranteed to match user’s login name
• isCallerInRole(String): Declare abstract role names in Deployment Descriptor
<method-permission> with <security-role-ref>, <role-name> elements

JavaBlackBelt’s SCBCD Study Guide page 13


2.2 Application Assembler: Mapping
• Define roles and assign method permissions (see Declarative Security) 4 Security Propagation with <run-as>
• Mapping: Add <role-link> element • Change the role the bean propagates as its outgoing identity, when calling other
beans
<enterprise-beans> • Not for Message Driven Beans!
<session>
<ejb-name>MyBean</ejb-name> <enterprise-beans>
... <session>
<security-role-ref> <ejb-name>MyBean</ejb-name>
<description>this role should be assigned to ....</description> ...
<role-name>Admin</role-name> <!-- optional, default value is <use-caller-identity/> -->
<role-link>Administrator</role-link> <security-identity>
</security-role-ref> <run-as>
</session> <role-name>OtherRole</role-name>
</enterprise-beans> </run-as>
</security-identity>
</session>
</enterprise-beans>
3 Principals and Roles, Users and Groups: Mapping
• In Operational Environment • Pages 591-592 [HFEjb]
- User (individuals, mapped to login name and password)
- Groups: organization of users
• In EJB
- User or Group authenticates Æ represented by a java.security.Principal
- Principal associated with abstract security role(s) (defined by
Application Assembler)
- Bean Provider optionally hard-codes security role references
• Deployer maps between abstract security roles and User/Group
• See page 590 [HFEjb]

JavaBlackBelt’s SCBCD Study Guide page 14


Enterprise Bean Environment <resource-ref>
<res-ref-name> without java:comp/env
1 java:comp/env <res-type> Legal:
• One bean environment per home - javax.sql.DataSource
• Look things up in bean’s business method: - javax.jms.QueueConnectionFactory
InitialContext ic = new InitialContext(); - javax.jms.TopicConnectionFactory
Type var = (Type) - javax.mail.Session
ic.lookup(“java:comp/env/[subcontext/]madeUpName“); - javax.net.URL
• Always cast. Narrow when it’s a remote home interface reference
• Bean Provider uses made-up name in the code, and declares it in the <res-auth> Container or Bean
Deployment Descriptor Bean: programmer uses
- anything followed by a slash, automatically becomes a subcontext getConnection(username, password)
• Deployer maps the made-up name to the real JNDI name of the resource Container: deployer must configure sign-on
• A single bean must not be deployed with more than one resource with the same information (vendor and resource specific)
name (different subcontext = different name!). <res-sharing-scope> Shareable (default) or Unshareable
Whether for other beans in same application,
Following sections explain the 4 possible resources to lookup, and how to using same resource, in the SAME transaction,
declare them. can use the same connection.
</resource-ref>
2 Environment Entries
• deployment-time values: cannot be changed dynamically, only by redeploying • Complete resource mapping: page 612 [HFEjb]

<env-entry> 4 Enterprise Bean Reference


<description> • When a bean wants to do a lookup of another bean’s home interface
<env-entry-name> without java:comp/env
Remote reference Local reference
<env-entry-type> Legal: String and wrapper classes
<ejb-ref> <ejb-local-ref>
<env-entry-value> Optionally set by Bean Provider,
Deployer must ensure validity <ejb-ref-name> without java:comp/env
</env-entry> <ejb-ref-type> Session or Entity
<home> <local-home> Fully qualified home interface
• Scope: private and unique to each home, so can reuse the same name for <remote> <local> Fully qualified component interface
another bean’s environment entry.
<ejb-link> Only if the referenced bean is in
the same application. Must match
3 Resource Manager Connection Factories <ejb-name> of the same DD
• Used for creating connections to a resource, e.g. DataSource for connecting to a See page 615 [HFEjb]
database.
</ejb-ref> </ejb-local-ref>

JavaBlackBelt’s SCBCD Study Guide page 15


5 Resource Environment References
• Directly gives the thing you want, the (JMS) destination
<resource-env-ref>
<resource-env-ref-name> without java:comp/env
<resource-env-ref-type> javax.jms.Queue
javax.jms.Topic
Others (not yet standardized)
</resource-env-ref>

JavaBlackBelt’s SCBCD Study Guide page 16


Appendix
The next sections contain the appendices:

• Exception Summary
• Transaction Summary
• Bean Class Schema
• Interfaces Schema
• Lifecycles
• What You Can Call
• DD Schema

JavaBlackBelt’s SCBCD Study Guide page 17


Exception Summary 2 System Exceptions
Æ to Memorize

Applications Local Clients (Unchecked!) java.lang.


System Exceptions RuntimeException
Exceptions
What? Runtime exceptions Checked, but don’t extend
and RemoteException RemoteException! javax.ejb. java.lang.
(checked, but not expected !) EJBException IllegalStateException

Client recovery? No Possible


javax.ejb.
Effect Send to client RemoteException Exactly as thrown NoSuchEntityException
as … (to remote client) or
EJBException (to local
client)
Tx status? Automatic rollback No rollback, unless javax.ejb.
NoSuchObjectLocalException
javax.ejb.
TransactionRequiredLocalException
javax.ejb.
TransactionRolledbackLocalException
setRollbackOnly was called
Bean instance Dies Lives
Logging? Yes No
Remote Clients (Checked!) java.rmi.
RemoteException

1 Application Exceptions
java.rmi. javax.ejb. javax.ejb.
NoSuchObjectException TransactionRequiredException TransactionRolledbackException

Checked! java.lang.
Exception

javax.ejb. javax.ejb. javax.ejb.


CreateException FinderException RemoveException

javax.ejb. javax.ejb.
DuplicateKeyException ObjectNotFoundException

JavaBlackBelt’s SCBCD Study Guide page 18


Transaction Summary
Æ to Memorize
Situation: methodA() calls methodB()…
methodA() within methodA() without
Attribute for methodB() transaction TxA, transaction, methodB()
methodB() within… within…
Required TxA TxA
RequiresNew TxB TxA
Mandatory TxA Exception
Supports TxA Unspecified tx Context
NotSupported Unspecified tx Context Unspecified tx Context
Never Exception Unspecified tx Context

CMT Bean Type Tx attribute required for …


Session beans business methods in the component interface
business methods
Component interface
remove() methods
Entity beans
methods written by the Bean
Home interface Provider
Remove() methods
Message-driven beans onMessage()

Run in “Unspecified Tx contect”…


1. All CMT methods marked NotSupported, Never or Supports
2. CMT Session Bean methods: Reason?
ejbCreate() (any of them) not part of client’s tx
ejbRemove() not part of client’s tx
ejbPassivate() never called when SB in tx
ejbActivate() never called when SB in tx
3. CMT Message-Driven Bean methods not part of client’s tx
ejbCreate() and ejbRemove()

JavaBlackBelt’s SCBCD Study Guide page 19


Bean Class Schema

Message-driven Session beans Entity beans


beans
Stateless Stateful CMP BMP
CMR BMR
ejbRemove() ; ; ;
setXxxContext(XxxContext) ; ; ;
Callbacks
Container

ejbActivate() ; ;
ejbPassivate() ; ;
ejbLoad() ;
ejbStore() ;
unsetEntityContext() ;
ejbCreate() Required Required
At least one Optional
Creation

ejbCreate<METHOD>(…) Forbidden Forbidden


ejbPostCreate<METHOD>(…) One matching for each
ejbCreate<METHOD>

busMethXxx(…)
Business Logic? onMessage(Message) busMethXxx(…)
ejbHome<METHOD>(…)
afterBegin()
SessionSynchronization beforeCompletion()
afterCompletion(boolean)

abstract
Persistent state? getter/setter Not in
Certification
Not implemented,
Objectives
nor declared.
finders (generated from
EJB-QL in DD)
abstract
selectors ejbSelectXxx

Remark: Gray areas mean that the option is not applicable in the given context.

JavaBlackBelt’s SCBCD Study Guide page 20


Interfaces Schema
java.r mi .Rem o te

javax.e jb.EJBH o me javax.ejb .EJBObje ct javax .ejb.E JB Lo calHo m e javax.ej b.EJBL oca lObject

getEJ BMetaD ata() get EJBH ome() remove(Objec t PK) getEJ BLocalH ome()
getH omeH andle() get Handle() getPrimaryK ey()
rem ove(H andle) get Prim aryKey() isIdentic al(EJ BLocalOb ject)
rem ove(O bject P K) isIdentical(E JBO bject)
remove()

ja vax. ejb.H om eH an dle


j avax .ejb.H an dle
g etE JBH om e()
g etE JBO bject()

java.io.S erializ able

j avax .ejb.E nterpri seB ean

javax.e jb.En tityBean javax.ejb .Session Bean javax.ejb .MessageD riven Bean

ejbR em ove() ejbRemove() ejb Remove()


setEntityContext(E ntityC ontext) setSessionC ontext(Sess ionC ontext) s et Mess ag eD rivenC ontext(MessageDrivenC ont ext)
ejbAc tivate() ejbActivate()
ejbPass ivate() ejbPassivate()
ejbLoad()
ejbStore()
uns etE ntityC ont ext()
javax.jm s.MessageL isten er
javax.e jb.EJBC on te xt

onMes sage(M essage)


getEJ BH om e()
getEJ BLocalH ome()
isC allerInR ole(String)
getC allerP rinc ipal()
getU serTransaction()
s etR ollbac kOnly()
getR ollback Only()

javax.ejb .EntityC o ntext j avax .ejb. javax.ejb.


Session Co ntext M e ssag eDr iven C on text
getEJB Loc alObjec t()
getEJB Object () getEJB LocalObjec t()
getPrimaryKey() getEJB Objec t()

javax.transaction .
U serT ransaction

begin()
comm it()
getStatus()
rollback()
setR ollback Only()

javax.ejb.
Session Syn chro niz atio n

afterBegin()
beforeC om pletion()
afterC ompletion(b oolean)

JavaBlackBelt’s SCBCD Study Guide - appendix page 21


SessionBean
EntityBean MessageDrivenBean
stateless stateful
Constructor nothing nothing nothing nothing
setXxxContext context. context. context. context.
; getEJB(Local)Home ; getEJB(Local)Home ; getEJB(Local)Home - setRollbackOnly (CMT)
for EB: - getEJB(Local)Object - getEJB(Local)Object - getEJB(Local)Object - getRollbackOnly(CMT)
unsetEntityContext - isCallerInRole(s)/getCallerPrincipal() - isCallerInRole(s)/getCallerPrincipal() - getPrimaryKey() - getUserTransaction (BMT)
- setRollbackOnly (CMT) - setRollbackOnly (CMT) - isCallerInRole(s)/getCallerPrincipal()
- getRollbackOnly(CMT) - getRollbackOnly(CMT) - setRollbackOnly (CMT) access
- getUserTransaction (BMT) - getUserTransaction (BMT) - getRollbackOnly(CMT) ; java:comp/env
access access - getUserTransaction (BMT) - other bean’s methods
; java:comp/env ; java:comp/env access - resource manager
- other bean’s methods - other bean’s methods ; java:comp/env
- resource manager - resource manager - other bean’s methods
- resource manager
ejbCreate context. context. context. context.
ejbRemove ; getEJB(Local)Home ; getEJB(Local)Home ; getEJB(Local)Home - setRollbackOnly (CMT)
; getEJB(Local)Object ; getEJB(Local)Object - getEJB(Local)Object - getRollbackOnly(CMT)
- isCallerInRole(s)/getCallerPrincipal() ; isCallerInRole(s)/getCallerPrincipal() - getPrimaryKey() ; getUserTransaction (BMT)
- setRollbackOnly (CMT) - setRollbackOnly (CMT) ; isCallerInRole(s)/getCallerPrincipal()
- getRollbackOnly(CMT) - getRollbackOnly(CMT) ; setRollbackOnly (CMT) access
- getUserTransaction (BMT) ; getUserTransaction (BMT) ; getRollbackOnly(CMT) ; java:comp/env
access access - getUserTransaction (BMT) - other bean’s methods
; java:comp/env ; java:comp/env access - resource manager
- other bean’s methods ; other bean’s methods ; java:comp/env
- resource manager ; resource manager ; other bean’s methods
; resource manager

ejbPostCreate context.
; getEJB(Local)Home
; getEJB(Local)Object
; getPrimaryKey()
; isCallerInRole(s)/getCallerPrincipal()
; setRollbackOnly (CMT)
; getRollbackOnly(CMT)
- getUserTransaction (BMT)
access
; java:comp/env
; other bean’s methods
; resource manager
Business method context. context. context. context.
- for SB, EB: from ; getEJB(Local)Home ; getEJB(Local)Home ; getEJB(Local)Home ; setRollbackOnly (CMT)
comp interface ; getEJB(Local)Object ; getEJB(Local)Object ; getEJB(Local)Object ; getRollbackOnly(CMT)
- for MDB: ; isCallerInRole(s)/getCallerPrincipal() ; isCallerInRole(s)/getCallerPrincipal() ; isCallerInRole(s)/getCallerPrincipal() ; getUserTransaction (BMT)
onMessage ; setRollbackOnly (CMT) ; setRollbackOnly (CMT) ; setRollbackOnly (CMT)
; getRollbackOnly(CMT) ; getRollbackOnly(CMT) ; getRollbackOnly(CMT) access
; getUserTransaction (BMT) ; getUserTransaction (BMT) - getUserTransaction (BMT) ; java:comp/env
access access access ; other bean’s methods
; java:comp/env ; java:comp/env ; java:comp/env ; resource manager
; other bean’s methods ; other bean’s methods ; other bean’s methods
; resource manager ; resource manager ; resource manager
Home business context.
method ; getEJB(Local)Home
- getEJB(Local)Object
- getPrimaryKey()
; isCallerInRole(s)/getCallerPrincipal()
; setRollbackOnly (CMT)
; getRollbackOnly(CMT)
- getUserTransaction (BMT)
access
; java:comp/env
; other bean’s methods
; resource manager
ejbActivate context. context.
ejbPassivate ; getEJB(Local)Home ; getEJB(Local)Home
; getEJB(Local)Object ; getEJB(Local)Object
; isCallerInRole(s)/getCallerPrincipal() ; getPrimaryKey()
- setRollbackOnly (CMT) - isCallerInRole(s)/getCallerPrincipal()
- getRollbackOnly(CMT) - setRollbackOnly (CMT)
; getUserTransaction (BMT) - getRollbackOnly(CMT)
access - getUserTransaction
; java:comp/env access
; other bean’s methods ; java:comp/env
; resource manager - other bean’s methods
- resource manager
ejbLoad context.
ejbStore ; getEJB(Local)Home
; getEJB(Local)Object
; getPrimaryKey()
; isCallerInRole(s)/getCallerPrincipal()
; setRollbackOnly (CMT)
; getRollbackOnly(CMT)
- getUserTransaction (BMT)
access
; java:comp/env
; other bean’s methods
; resource manager
Lifecycles

session/message beans entity beans

bean throws does not


bean throws
system exception
does not timeout system exception
exist exist
new instance ejbRemove
setXxxContext or timeout new instance
ate setXxxContext
ctiv passive unsetEntityContext
e j b A
ejbCreate

e ejbFindXxx
ivat pooled
ready ass or ejbSelectXxx
ejbP or ejbHomeXxx

ejbCreate
ejbPostCreate
ejbActivate ejbRemove
orejbPassivate

business methods
ejbLoad ejbSelect
ejbStore ready

business methods (comp intf)

black: stateless session bean + message driven bean


black + green italic: stateful session bean
black + red times: entity bean
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
"http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<enterprise-beans>
<entity>
<description>Entity bean description</description>
<display-name>Display name for tools</display-name>
<small-icon>File name of a JPEG/GIF image</small-icon>
<large-icon>File name of a JPEG/GIF image</large-icon>
<ejb-name>SomeEntityBean</ejb-name>
<home>com.company.EntityBeanRemoteHome</home>
<remote>com.company.EntityBeanRemote</remote>
<local-home>com.company.EntityBeanLocalHome</local-home>
<local>com.company.EntityBeanLocal</local>
<ejb-class>com.company.EntityBeanEJB</ejb-class>
<persistence-type>Container / Bean</persistence-type>
<prim-key-class>com.company.EntityBeanPK</prim-key-class>
<reentrant>False / True</reentrant>
<cmp-version>2.x /1.x</cmp-version>
<abstract-schema-name>EntityBean</abstract-schema-name>
<cmp-field><field-name>field1</field-name></cmp-field> <!--optional-->
<cmp-field><field-name>field2</field-name></cmp-field> <!--optional-->
<primkey-field>field1</primkey-field>
<env-entry> <!--optional-->
<description>Environment entry description</description>
<env-entry-name>envEntry1</env-entry-name>
<env-entry-type>java.lang.Integer</env-entry-type>
<env-entry-value>2000</env-entry-value>
</env-entry>
<ejb-ref> <!--optional-->
<description>EJB reference description</description>
<ejb-ref-name>ejb/OtherEntityBeanHomeRemote</ejb-ref-name>
<ejb-ref-type>Entity /Session</ejb-ref-type>
<home>com.company.OtherEntityBeanRemoteHome</home>
<remote>com.company.OtherEntityBeanRemote</remote>
<ejb-link>SomeEntityOrSessionBeanName</ejb-link>
</ejb-ref>
<ejb-local-ref> <!--optional-->
<description>Local EJB reference description</description>
<ejb-ref-name>ejb/OtherLocalEntityBeanHomeRemote</ejb-ref-name>
<ejb-ref-type>Entity / Session</ejb-ref-type>
<local-home>com.company.OtherLocalEntityBeanRemoteHome</local-home>
<local>com.company.OtherLocalEntityBeanRemote</local>
<ejb-link>SomeEntityOrSessionBeanName</ejb-link>
</ejb-local-ref>

Bean Provider
Application Assembler
Deployer
Bold: Mandatory elements
Red: Default values
<resource-ref> <!--optional-->
<description>Some DataSource description</description>
<res-ref-name>jdbc/SomeDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container / Application</res-auth>
<res-sharing-scope>Shareable / Unshareable</res-sharing-scope>
</resource-ref>
<resource-env-ref> <!--optional-->
<description>Some DataSource description</description>
<resource-env-ref-name>jms/SomeQueue</resource-env-ref-name>
<resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
</resource-env-ref>
<security-role-ref> <!--optional-->
<description>Security role reference description</description>
<role-name>Manager</role-name>
<role-link>Administrator</role-link>
</security-role-ref>
<security-identity> <!--optional-->
<description>Security identity description</description>
<run-as>
<description>Run as description</description>
<role-name>Manager</role-name>
</run-as>
OR
<use-caller-identity />
</security-identity>
<query> <!--optional-->
<description>Query description</description>
<query-method>
<method-name>findSomething</method-name>
<method-params> <!--optional-->
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<result-type-mapping>Local / Remote</result-type-mapping>
<ejb-ql>SELECT OBJECT(e) FROM EntityBean e WHERE e.field1 = ?1</ejb-ql>
</query>
</entity>

Bean Provider
Application Assembler
Deployer
Bold: Mandatory elements
Red: Default values
<session>
<description>Session bean description</description>
<display-name>Display name for tools</display-name>
<small-icon>File name of a JPEG/GIF image</small-icon>
<large-icon>File name of a JPEG/GIF image</large-icon>
<ejb-name>SomeSessionBean</ejb-name>
<home>com.company.SessionBeanRemoteHome</home>
<remote>com.company.SessionBeanRemote</remote>
<local-home>com.company.SessionBeanLocalHome</local-home>
<local>com.company.SessionBeanLocal</local>
<ejb-class>com.company.SessionBeanEJB</ejb-class>
<session-type>Stateful / Stateless</session-type>
<transaction-type>Container / Bean</transaction-type>
<env-entry> <!--optional-->
...
</env-entry>
<ejb-ref> <!--optional-->
...
</ejb-ref>
<ejb-local-ref> <!--optional-->
...
</ejb-local-ref>
<resource-ref> <!--optional-->
...
</resource-ref>
<resource-env-ref> <!--optional-->
...
</resource-env-ref>
<security-role-ref> <!--optional-->
...
</security-role-ref>
<security-identity> <!--optional-->
...
</security-identity>
</session>

Bean Provider
Application Assembler
Deployer
Bold: Mandatory elements
Red: Default values
<message-driven>
<description>Message-driven bean description</description>
<display-name>Display name for tools</display-name>
<small-icon>File name of a JPEG/GIF image</small-icon>
<large-icon>File name of a JPEG/GIF image</large-icon>
<ejb-name>SomeMDBean</ejb-name>
<ejb-class>com.company.MDBeanEJB</ejb-class>
<transaction-type>Container / Bean</transaction-type>
<message-selector>Some message selector</message-selector>
<acknowledge-mode>Auto-acknowledge / Dups-ok-acknowledge</acknowledge-mode>
<message-driven-destination> <!--optional-->
<destination-type>javax.jms.Queue / javax.jms.Topic</destination-type>
<subscription-durability>Durable / NonDurable</subscription-durability>
</message-driven-destination>
<env-entry> <!--optional-->
...
</env-entry>
<ejb-ref> <!--optional-->
...
</ejb-ref>
<ejb-local-ref> <!--optional-->
...
</ejb-local-ref>
<resource-ref> <!--optional-->
...
</resource-ref>
<resource-env-ref> <!--optional-->
...
</resource-env-ref>
<security-identity> <!--optional-->
<description>MDB Security identity description. Only run-as!!</description>
<run-as>
<description>Run as description</description>
<role-name>Manager</role-name>
</run-as>
</security-identity>
</message-driven>
</enterprise-beans>

Bean Provider
Application Assembler
Deployer
Bold: Mandatory elements
Red: Default values
<relationships> <!--optional-->
<description>Relationships description</description>
<ejb-relation>
<description>EJB Relation description</description>
<ejb-relation-name>Entity1-Entity2</ejb-relation-name>
<ejb-relationship-role>
<description>EJB Relationship role description</description>
<ejb-relationship-role-name>Entity1-has-an-Entity2</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<description>EJB Relationship role source description</description>
<ejb-name>SomeEntityBean</ejb-name>
</relationship-role-source>
<cmr-field> <!-- optional -->
<description>Container-managed relationship field description</description>
<cmr-field-name>cmrField1</cmr-field-name>
<cmr-field-type>java.util.Collection / java.util.Set</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<description>EJB Relationship role description</description>
<ejb-relationship-role-name>Entity2-belongs-to-Entity1</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<cascade-delete /> <!-- only allowed if other role source has multiplicity One!! -->
<relationship-role-source>
<description>EJB Relationship role source description</description>
<ejb-name>SomeOtherEntityBean</ejb-name>
</relationship-role-source>
</ejb-relationship-role>
</ejb-relation>
<ejb-relation>
...
</ejb-relation>
</relationships>

Bean Provider
Application Assembler
Deployer
Bold: Mandatory elements
Red: Default values
<assembly-descriptor> <!--optional-->
<security-role> <!--optional-->
<description>Security role description</description>
<role-name>Administrator</role-name>
</security-role>
<method-permission> <!--optional-->
<role-name>everyone</role-name> OR <unchecked />
<method> <!--Style 1-->
<description>Style 1 Method description</description>
<ejb-name>SomeEntityBean</ejb-name>
<method-intf>Home / Remote / LocalHome / Local</method-intf>
<method-name>*</method-name>
</method>
<method> <!--Style 2-->
<description>Style 2 Method description</description>
<ejb-name>SomeEntityBean</ejb-name>
<method-intf>Home / Remote / LocalHome / Local</method-intf>
<method-name>create</method-name>
</method>
<method> <!--Style 3-->
<description>Style 3 Method description</description>
<ejb-name>SomeEntityBean</ejb-name>
<method-intf>Home / Remote / LocalHome / Local</method-intf>
<method-name>createSomething</method-name>
<method-params> <!--optional-->
<method-param>java.lang.String</method-param>
</method-params>
</method>
</method-permission>
<container-transaction> <!--optional-->
<description>Container transaction description</description>
<method> <!-- Style 1, 2 or 3-->
<ejb-name>SomeEntityBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required/RequiresNew/Mandatory/Never/Supports/NotSupported</trans-attribute>
</container-transaction>
<exclude-list> <!--optional-->
<description>Exclude list description</description>
<method> <!-- Style 1, 2 or 3-->
<ejb-name>SomeEntityBean</ejb-name>
<method-name>method1</method-name>
</method>
</exclude-list>
</assembly-descriptor>
<ejb-client-jar>someOtherClientJarFile.jar</ejb-client-jar> <!-- optional -->
</ejb-jar>

Bean Provider
Application Assembler
Deployer
Bold: Mandatory elements
Red: Default values

You might also like