Best Regards<br />N.Shankar<br />SCJP, SCWCD
Best Regards<br />N.Shankar<br />SCJP, SCWCD
Originally posted by Natarajan Shankar:
Good, I got the real sense you mean it now.
As per the EJB Architecture the client can access only the HME object and the home is responsible to creat the EJB OBject.
>>ExampleHome examplehome = (ExampleHome)PortableRemoteObject.narrow>>(homeObject, ExampleHome.class);
So the first staement say about casting
>>Example example = (Example)PortableRemoteObject.narrow(examplehome.create(), Example.class);
Now for remote it cannot be like this since we're not CREATING EJBObject, we're getiing only the HANDLE created by EJBHOme.
>>why the following way is preffered?
>>Example example = (Example)examplehome.create();
The above staement says your creating a handle through EJBHOMe. AS we known on examplehome.create(, will call ejbCreate() to create EJBObject.
Hope you got the reason if not key-in query.
Best Regards<br />N.Shankar<br />SCJP, SCWCD
Originally posted by Natarajan Shankar:
Can you please explain
>> 1) What is the difference between EJB Handle and EJB Object Reference.
Boss inthe explanation I given EJBHanle is EJB Object
>> 2) Does Local Interface components will have handle?
** Yes, while doing lookup() process, actually server will return a EJB Home stub to the client.
** Then by using that EJBHome stub client will call create() method which will return EJBObject (Remote intrface) stub to client. Then by using this stub user can invoke business methods.
3) Why we are not doing narrowing in Local EJB Home object lookup?
This question I dont understnad boss, can you explain bit more.
1) What is the difference between EJB Handle and EJB Object Reference.
2) Does Local Interface components will have handle?
Alex (SCJP 1.4, SCBCD 1.3, SCWCD 1.4, SCJD 1.4)
Originally posted by Alex Sharkoff:
Therefore, the difference bw ejb object reference and a handle is that a handle is used to get a reference to an original ejb object while an ejb object reference (i.e. stub) is used to communicate with the remote object (i.e. ejb object) over the wires.
No.
Local home and component interfaces live in the same jvm as the actual bean (i.e. ejb container's jvm) and therefore, do not have anything that has to do with the remote method invocations.
Handle on the other hand is something that a remote client uses to get access to the original remote object.
![]()
I can't take it! You are too smart for me! Here is the tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|