Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFEJB - Doubt regarding mock xxam question 6 on page 245

 
Srini Madala
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question is regarding method declaraion in a component interface, which session bean can have the create method with parameters.

MyBean create(String name) throws CreateException, RemoteException;

The answer marked is only stateful session bean. I know that the create method with parameters can only be used for Stateful session beans, but the question is missing "public". Is it still valid? I don't want to miss a question on exam for this simple reason by take it granted that public is implied as mentioned in the HFEJB book.
 
Keerthi P
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Methods declared in an interface are by default 'public' and 'abstract'. So the component interface methods need not be explicitly declared public. It is valid even it is missing the 'public' keyword.
[ March 09, 2005: Message edited by: Keerthi P ]
 
Srini Madala
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Keerthi!!!
 
raj guntupalli
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1)I think you cannot define a create exception in the remote interface
(home interface)
2)You cannot return the bean itself but an ejbobject which represents the bean
3) For a stateful session bean there can be any number of create methods with different parameters which will be represented by a EJBCreate in the bean
 
amol deshpande
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ouuups
....
raj.....
...may be....
1) st point needs reconsideration....
you must have CreateException for create methods in home for both...local or remote views!!!
rest 2 points are fine.
amol
 
Gemini Moses
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. I agree with Amol.
 
Chengwei Lee
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I think answer should be D instead of A. The SessionBean interface does not contain such a method. In fact, even the implementation class of a SessionBean interface don't. It contains an ejbCreate method instead. Most importantly, this method is found under the remote home interface.

In this situation, I think either the question was not properly phrased (rather misleading with the session bean interface) or the provided answer was wrong.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic