1Z0-895 · Question #89
A developer wants to create a JMS message-driven bean that responds to javax.jms.TextMessage messages. Which two statements are true? (Choose two.)
The correct answer is B. The developer does NOT need to create a business interface for the bean. D. The message-driven bean class must implement methods of the javax.jms.TextMessageListener interface. 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…
Question
Options
- AThe developer must implement the ejbCreate method.
- BThe developer does NOT need to create a business interface for the bean.
- CThe developer must implement a method that declares javax.jms.TextMessage as an argument.
- DThe message-driven bean class must implement methods of the javax.jms.TextMessageListener interface.
- EThe message-driven bean class must implement methods of the javax.ejb.MessageDrivenBean interface.
How the community answered
(25 responses)- A16% (4)
- B76% (19)
- C4% (1)
- E4% (1)
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. The Java EE 6 Tutorial,What Is a Message-Driven Bean?
Topics
Community Discussion
No community discussion yet for this question.