Why bean is not implementing the component interface?
Thanks
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35252
7
posted
0
Welcome to JavaRanch.
Which interface called Component are you talking about? The only one in J2SE/JEE with that name is java.awt.Component, but that has nothing to do with EJB. [ September 28, 2007: Message edited by: Ulf Dittmer ]
Maybe I'm a bit dense, but there is no interface called Component in EJB (as I mentioned in my previous post). Can you describe in more detail what you're asking about, or post the fully qualified class name (including the package)? [ September 28, 2007: Message edited by: Ulf Dittmer ]
Somnath Jamdar
Greenhorn
Joined: May 28, 2004
Posts: 22
posted
0
Hi Priteshaaa,
Because Component Interface is a Client View of a bean and bean resides and executes on the server in a different tier.
Container will provide the implementation for methods [getEJBLocalHome(), getPrimaryKey(), remove(), etc] defined in EJBLocalObject/EJBObject.
But the bean should provide implementation for the business method defined in the component interface.
HTH
Somnath Jamdar<br />SCJP, SCWCD
Awishek sinha
Ranch Hand
Joined: Jun 24, 2007
Posts: 62
posted
0
Originally posted by Priteshaaa Agrawal: Hi,
Why bean is not implementing the component interface?
Thanks
Hi Priteshaaa the bean class is not required to implement the component interface (but you can do so..)as its not a marker interface(as it extends EJBObject which has methods decalred in it like remove(),getHandle() etc)so if you do so the you have to write the concrete implementation of that methods . So at the time deployment the deployer tells the container that here is the component & home interface of this bean ,the container would implement these interface by constructing an class called EJBObject & EJBHome which the client would use to intract with the bean.. Hope it clears..
Awishek Kr Sinha<br />SCJP 1.4<br />SCBCD 1.3
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.