Вы находитесь на странице: 1из 5

Applying Enterprise JavaBeans, Second

Edition
hung1708@gmail.com

1. Both session and entity beans can implement local and remote client views, and
generally the same considerations apply. However, an entity bean must implement a
local client view in what situation?

A. When the application uses message-driven beans.

B. When the entity bean is a target of a container-managed relationship.

C. When the entity bean is located in a different JVM from the client.
When the application uses a session bean as a facade to a set of entity
D. beans.

2. The EJB 2.1 architecture includes an SQL-like query language, EJB Query Language
(EJB QL), that is portable across EJB containers. This language can be used to express
queries for

A. Message-driven beans

B. Session beans implementing remote client views

C. Entity beans with container-managed persistence

D. Stateless session beans

3. An EJB application may use message-driven bean components to asynchronously


receive messages provided that the messages are delivered by which message service:

A. Java Message Service (JMS)

B. Java API for XML Messaging (JAX-M)


C. Any other messaging system

D. JMS, JAX-M, or any other messaging system

E. None of the above

4. Implementing a message-driven bean requires that the developer extend two


interfaces: a message listener interface and

A. a javax.ejb.SessionBean interface

B. a javax.ebj.MessageDrivenBean interface

C. an event listener interface

D. a javax.ebj.EJBHome interface

5. A message-driven bean developed for a JMS messaging system puts its business
processing logic within which method:

A. setSessionContext method

B. onMessage method

C. ejbRemove method

D. setMessageDrivenContext method

E. a user-defined method

6. If you use container-managed transaction demarcation, you can set a message-driven


bean to participate in a transaction. To ensure that message delivery from the message
destination to the message-driven bean is part of the subsequent transactional work,
set the message-driven bean's transaction attribute (in the deployment descriptor) to

A. NotSupported

B. Mandatory

C. Required
D. Supports

7. The EJB timer service is used for timing notifications. It can be used with

A. CMP entity beans

B. both BMP and CMP entity beans

C. message-driven beans

D. B and C

E. A and C

F. None of the above

8. EJB Timer objects are stateless objects, with the same characteristics as stateless
session beans.

A. True

B. False

9. An enterprise bean may set up a timer notification using the TimerService's


createTimer method. Such timer notification may occur

A. After a specified duration

B. At a specified time

C. On a recurring basis

D. All of the above

E. None of the above

10. The J2EE 1.4 platform includes a set of Web services technologies for developing
Web services applications. Developers can use the following technologies to write a
Web service Java interface or service endpoint interface:
Java API for XML Processing (JAX-P) and Java API for XML Binding
A. (JAX-B)

B. SOAP with Attachments API for Java (SAAJ)

C. Java API for XML-based RPC (JAX-RPC) and enterprise bean components

D. Java API for XML Registries (JAX-R)

11. To develop a Java interface for a Web service-the service endpoint interface-you must
start with the WSDL (Web Services Description Language) document for the service.

A. True

B. False

12. Which type of enterprise bean is particularly well suited for developing a JAX-RPC
service endpoint interface for a Web service?

A. A messaged-driven bean

B. An entity bean

C. A stateless session bean

D. A Timer object

E. A stateful session bean

13. When developing an enterprise bean as a JAX-RPC service endpoint interface for a
Web service, you must adhere to the following rule:

The bean must not extend java.rmi.Remote nor should its methods throw
A. java.rmi.RemoteException

B. The bean's methods must use remote reference types


Deploy the bean using a special Web services deployment descriptor,
C. webservices.xml.

D. None of the above.


14. Enterprise beans can be used to access Web services. To do so, the bean must:

Declare a service-ref element in its deployment descriptor that contains


A. appropriate information to look up the Web service endpoint.

B. Package the Web service endpoint into an ejb-jar file.

C. Create a webservices.xml file containing the Web service.

D. Include a JAX-RPC handler in its code.

15. For a new Web service developed using enterprise beans, you must package its
components into an ejb-jar file. Which of the following are not packaged into the ejb-
jar file:

A. All classes referenced from the bean class and the interface

B. The WSDL file

C. The deployment descriptor for the Web service


The stubs, skeletons, and serialization/deserialization code for translating
D. SOAP requests to invocations on the bean class.

ANSWERS

1B
2C
3D
4B
5B
6C
7D
8B
9D
10C
11B
12C
13C
14A
15D

Вам также может понравиться