Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

HFEJB - Doubt regarding mock xxam question 6 on page 245

 
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.
 
Ranch Hand
Posts: 211
  • 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!!!
 
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
 
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
 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. I agree with Amol.
 
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.
 
Wanna see my flashlight? How about this tiny ad?
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic