• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SCBCD :Can a session bean clss implement the session bean's component interface ?

 
Sandeep Shahane
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I came across a question in Mock SCBCD exam as

Which of the following statements are requirements for a session bean's session bean class? [Select all correct answers] 1 The class must implement the javax.ejb.SessionSynchronization interface.
2 The class must implement the javax.ejb.SessionBean interface.
3 The class may implement the session bean's component interface.
4 The class can be declared final.
5 If the class is a stateful session bean, the constructor must declare parameters to initialise the session state.



My answer was 2 only. Can a session bean clss implement the session bean's component interface ?

And this was the exaplaination given
Explanation
Answers 2 and 3 are correct.

Answer 1 is incorrect because the javax.ejb.SessionSynchronization interface is optional and should only be implemented by stateful session bean classes that require notification by the container of transaction boundaries.

Answer 4 is incorrect. The session bean class cannot be declared final to provide the container with an opportunity to extend the class should it wish to mix in some container-specific code with the session bean class.

Answer 5 is incorrect. The container must declare a public constructor that take no parameters so that the container can create instances of the session bean class.
 
Ugender Rekulampally
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sandeep,

Yes answers are 2 and 3 sadly

Technically, your session bean can implement the component interface but that is not recommended/necessary in Specs way.

Have fun in digging.

Ugender
 
Abhishek Mahanty
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good explanation on Pg 85 of HFEJB

Abhi.
[ July 26, 2006: Message edited by: Abhishek Mahanty ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic