• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

HFEJB - Doubt regarding mock xxam question 6 on page 245

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Keerthi!!!
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. I agree with Amol.
 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Self destruct mode activated. Instructions for deactivation encoded in this tiny ad.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic