driven bean?

Given code snippets from two files:
7. public class Dog {
8. public void onMessage(Message m) { System.out.print(“1 “); }
9- }
and
10. @MessageDriven
11. class MessageDog extends Dog implements MessageDrivenBean {
12. MessageDog(Message m) { System.out.print(“2 “); }
13. }
Which four code changes, when used together, create a valid JMS messagE. driven bean?
(Choose four.)

Given code snippets from two files:
7. public class Dog {
8. public void onMessage(Message m) { System.out.print(“1 “); }
9- }
and
10. @MessageDriven
11. class MessageDog extends Dog implements MessageDrivenBean {
12. MessageDog(Message m) { System.out.print(“2 “); }
13. }
Which four code changes, when used together, create a valid JMS messagE. driven bean?
(Choose four.)

A.
Make class MessageDog public.

B.
Make the MessageDog constructor no-arg.

C.
Make the MessageDog constructor public.

D.
Move the onMessage method to class MessageDog.

E.
Change MessageDog so that it is NOT a subclass of Dog.

F.
Make class MessageDog implement MessageListener instead of MessageDrivenBean.



Leave a Reply 0

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