Meaningless Drivel is fun!*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes HFEJB final Mock Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "HFEJB final Mock Question" Watch "HFEJB final Mock Question" New topic
Author

HFEJB final Mock Question

Gemini Moses
Ranch Hand

Joined: Jan 04, 2001
Posts: 245
HFEJB final Mock -
Page 647

35 Which methods can be called by a bean provider?

A. remove
b. ejbCreate
c. afterBegin
d. getCallerPrincipal
e. ejbPassivate

I answered ONLY D
Correct answer is A, D

What is the meaning of A? Are they refering to remove on another bean?
Is this one of the controversial question?

Gemini
[ April 03, 2005: Message edited by: Gemini Moses ]
Srini Madala
Greenhorn

Joined: Feb 27, 2005
Posts: 16
All the methods in EJBContext (i.e. SessionContext, EntityContext, and MessageDrivenBean) interfaces are called by only container. These methods are SetXXXXContext, ejbCreate, ejbRemove, ejbPassivate, ejbActivate etc.

The bean provider can call the methods in Home and Component interfaces. Obviously in the options, these are remove (either from home or component interface) and security context methods (such as getCallerPrincipal, isCallerInRole).

Hope this helps...


Srini Madala<br /> <br />SCJP2, SCWCD1.3, SCBCD1.3
Gemini Moses
Ranch Hand

Joined: Jan 04, 2001
Posts: 245
Thanks Srini for answering my question.

However I am not getting it still.
Where do bean provider call remove from?
Bean provider is going to write, bean class and home and componenet interface.
Client can call remove on home and component interfaces.
Where is Bean provider going to call remove from? bean class, home inetrface, component interface.

The only thing I can think of is bean provider calling remove from bean code. and in that case remove can be on another bean that it is refering to.

Please explain.
Thanks!
Gemini
Sun Raj
Greenhorn

Joined: Mar 09, 2005
Posts: 11
Hi,
I think the question is vague.
I am a bean provider and in one of the bean implementations I have a overloaded ejbCreate. One of the ejbCreates has the common functionality which other ejbCreates call. Is this not possible? Therefore, as a bean provider I am able to call ejbCreate.
Would appreciate clarification.
TIA.

-SR
Chengwei Lee
Ranch Hand

Joined: Apr 02, 2004
Posts: 884
The remove method that is being referred to is the remove(Object pk), remove(Handle h) or remove() method in the EJBHome/EJBObject interfaces.

You're probably confusing it with the remove method (that client invokes) that will trigger off the ejbRemove method.


SCJP 1.4 * SCWCD 1.4 * SCBCD 1.3 * SCJA 1.0 * TOGAF 8
Chengwei Lee
Ranch Hand

Joined: Apr 02, 2004
Posts: 884
Originally posted by Sun Raj:
Hi,
I think the question is vague.
I am a bean provider and in one of the bean implementations I have a overloaded ejbCreate. One of the ejbCreates has the common functionality which other ejbCreates call. Is this not possible? Therefore, as a bean provider I am able to call ejbCreate.
Would appreciate clarification.
TIA.

-SR


ejbCreate is more of a container callback method. The Bean Provider don't control when it gets invoked.
Gemini Moses
Ranch Hand

Joined: Jan 04, 2001
Posts: 245
Chengwei wrote-
You're probably confusing it with the remove method (that client invokes) that will trigger off the ejbRemove method.


As I understand the remove method that client invokes are the once you specifed above. (2 from home and one from component interface) which trigger ejbRemove.

Not getting what you are trying to say here?
[ April 04, 2005: Message edited by: Gemini Moses ]
Chengwei Lee
Ranch Hand

Joined: Apr 02, 2004
Posts: 884
What I'm trying to say is that a bean can invoke of another bean. And if we wishes to remove a bean, we invoke the remove method rather than the ejbRemove method in our bean codes.
amol deshpande
Ranch Hand

Joined: Sep 05, 2003
Posts: 162
Hi there Gemini,
Please try to collece what question is trying to say.What a BP can call...a BP may write a bean and create another bean in a buz method, and then call remove on component/home interface to get rid of it.
The question is trying to test you upon what you (BP) should not call and what he may call.
Amol.
 
GeeCON Prague 2014
 
subject: HFEJB final Mock Question