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 final Mock Question

 
Gemini Moses
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Gemini Moses
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 884
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Chengwei Lee
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 884
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic