Which two statements are true?

A developer wants to create a JMS message-driven bean that responds to javax.jms.TextMessage
messages. Which two statements are true? (Choose two.)

A developer wants to create a JMS message-driven bean that responds to javax.jms.TextMessage
messages. Which two statements are true? (Choose two.)

A.
The developer must implement the ejbCreate method.

B.
The developer does NOT need to create a business interface for the bean.

C.
The developer must implement a method that declares javax.jms.TextMessage as an
argument.

D.
The message-driven bean class must implement methods of the
javax.jms.TextMessageListener interface.

E.
The message-driven bean class must implement methods of the javax.ejb.MessageDrivenBean
interface.

Explanation:
B: *Client components do not locate message-driven beans and invoke methods
directly on them. Instead, a client accesses a message-driven bean through, for example, JMS by
sending messages to the message destination for which the message-driven bean class is
the MessageListener.
D: *A message-driven bean is an enterprise bean that allows Java EE applications to process
messages asynchronously. This type of bean normally acts as a JMS message listener, which is
similar to an event listener but receives JMS messages instead of events.
*In a fashion similar to a Message-Driven Bean (MDB) in the EJB world, the Message-Driven
POJO (MDP) acts as a receiver for JMS messages. The one restriction (but see also below for the
discussion of the MessageListenerAdapter class) on an MDP is that it must implement the
javax.jms.MessageListener interface.
Reference:The Java EE 6 Tutorial,What Is a Message-Driven Bean?



Leave a Reply 3

Your email address will not be published. Required fields are marked *


Tamer

Tamer

there is nothing called javax.jms.TextMessageListener interface.

Andrei

Andrei

B),C)

C) because we need a method onMessage( javax.jms.TextMessage message)