Forums Register Login

HFEJB - Doubt regarding mock xxam question 6 on page 245

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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 ]
+Pie Number of slices to send: Send
Thanks Keerthi!!!
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
Yes. I agree with Amol.
+Pie Number of slices to send: Send
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.
You’ll find me in my office. I’ll probably be drinking. And reading this tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 737 times.
Similar Threads
Bean Lookup Using Custom Constructor
Session Bean Methods Call
SCBCD :Can a session bean clss implement the session bean's component interface ?
About page 126 of HFEJB
create methods
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 10:02:20.