nerdexam
Oracle

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…

JMS and Message-Driven Beans

Question

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

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)
  • A
    16% (4)
  • B
    76% (19)
  • C
    4% (1)
  • E
    4% (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

#message-driven beans#TextMessage#MessageListener interface#business interface

Community Discussion

No community discussion yet for this question.

Full 1Z0-895 Practice