JavaBeat
Search JavaBeat

SCBCD TOPICS

scbcd Home

objectives

mock exams

scbcd mock - 1

scbcd mock - 2

scbcd mock - 3

scbcd mock - 4

scbcd mock - 5

scbcd mock - 6

scbcd mock - 7

scbcd mock - 8

scbcd mock - 9

scbcd mock - 10

scbcd mock - 11

scbcd mock - 12

scbcd mock - 13

scbcd mock - 14

JAVABEAT
home
articles
tips
code junction
forums
OUR NETWORK
javabeat

SCBCD Mock Questions - 12

1)What will happen when you try to compile the following message driven bean? Assume all packages are correctly imported.


1.   public class GatewayBean implements MessageDrivenBean, MessageListener {
2.      public GatewayBean(){}
3.      public void ejbCreate(){}
4.      public void onMessage(TextMessage msg){}
5.      public void ejbRemove(){}
6.      public void setMessageDrivenContext(MessageDrivenContext ctx){}
7.   }
1)Compilation error, incorrect declaration on line 3.
2)Compilation error, incorrect declaration on line 4.
3)The code compiles fine.
4)Compilation error, the GatewayBean class must be declared abstract.
5)Compilation error, the GatewayBean class must be declared final.

2)Which of the following is assumed to be the correct sequence of methods that are called in the lifecycle of a message-driven bean?

1)setMessageDrivenContext(), newInstance(), ejbCreate(), onMessage()
2)newInstance(), setMessageDrivenContext(), ejbCreate(), onMessage()
3)newInstance(), ejbCreate(), setMessageDrivenContext(), onMessage()
4)onMessage(), newInstance(), setMessageDrivenContext(), ejbCreate()
5)ejbCreate(), newInstance(), setMessageDrivenContext(), onMessage()

3)Which of the following interfaces need to be implemented by a message driven bean? [Select all correct answers]

1)MessageDrivenBean
2)MessageDrivenbean
3)MessageListener
4)MessageDrivenContext
5)TextMessage

4)Which of the following methods will cause an IllegalStateException when used from within the message-driven bean onMessage() method? [Select all correct answers]

1)getEJBHome()
2)getRollbackOnly()
3)getUserTransaction()
4)isCallerInRole()
5)getCallerPrincipal()

5)Identify the correct message-driven bean method that can be used to access a bean managed entity bean?

1)ejbCreate()
2)message-driven bean constructor.
3)onMessage()
4)you cannot access a bean managed entity bean from a message-driven bean.
5)setMessageDrivenContext()

6)______ is thrown when the message bean invokes the isCallerInRole() method from the MessageDrivenContext interface. [Do not include the name of the package]

7)Which of the following statements about message driven beans are correct? [Select all correct answers]

1)The bean class must be public, final and must not be abstract.
2)The bean class must be public, not final and must not be abstract.
3)The bean class must have a non-argument ejbCreate method.
4)The bean class must only implement the MessageDrivenBean interface.
5)Methods in a message driven bean cannot throw a RuntimeException

8)Which of the following statements are true about acknowledgement of messages within message-driven beans? [Select all correct answers]

1)A message arrived in onMessage() is placed back on the message queue if the transaction rolls back for container managed message beans.
2)A message arrived in onMessage() within a container managed message bean is placed back on the message queue when the onMessage() method returns false.
3)A message arrived in onMessage() within a container managed message bean is placed back on the message queue when the onMessage() throws a checked exception.
4)A container managed message bean can use the deployment descriptor to define how messages are acknowledged to the message service.
5)The <acknowledge-mode> attribute defines the way bean managed message bean's send an acknowledgement to the message service when the transaction has failed.

9)Which of the following onMessage() declarations is correct in the message driven bean class?

1)public void onMessage(Message message)
2)public void onMessage(Message message) throws RemoteException
3)public String onMessage(Message message)
4)public String onMessage(Message message) throws RemoteException
5)public static void onMessage(Message message)

10)The ______ tag is used to indicate the acknowledgement mode used for bean managed message beans. [Enter the name of the tag, do not include the opening and closing braces]

SCBCD Mock Questions 12 - Answers


Sponsors
Webmaster Hosting Forum
Java Jobs
MyVideoLib
India News
Internet Advances
Latest QnA
SCJD Tips
When we start a thread by applying start() method on it ,how does it knows that to execute run()method?
About Wrapper class in Java
How to configure weblogic 7.0 in MyEclipse?
Static Block and Static Initializer in Java

JavaBeat Media (2004-2008), India
javabeat | planetoss | links directory | advertise
Copyright (2004 - 2008), JavaBeat