This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Query related to Narrowing  RSS feed

 
Ranch Hand
Posts: 209
Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Spec says


When the EJB 2.1 and earlier remote home and remote component interfaces are used, the narrowing of remote types requires the use of javax.rmi.PortableRemoteObject.narrow rather than Java language casts.


Now I have many queries related to this

What i have understood in RMI is that when you do lookup you get a STUB(which takes care of all the n/w complexities) and not an actual implementation.
So when you register your business object eg "abcInstance" ,the container will actually register a stub object which the client will later do lookup ,
( i assume that the container might have followed this procedure to create a STUB )
a) It will first see which business interface this instance is implementing.
b) And then create a stub which has all the method implemented of the interface.

So that means it is not necessary that the STUB and the actual implementation be always SAME ! because the stub is having only those methods which are mentioned in the interface,while the actual
implementation class might have more methods
So now my Question to everyone is that it does not make sense for a client to actually do narrowing.
Because when he does lookup he receives a stub instance which he stores in Business interface reference, so when he narrow's ,he'll narrow down to stub which has same methods which are there in the interface
so does not make sense to actually narrow down.

Can someone put light on this and correct me if i have got wrong somewhere.
My above explanation can be totally wrong if the container creates a STUB base on the actual implementation class rather then the interface.So can someone confirm what actually happens ??

Q2) the above quote of spec has mentioned narrowing information about EJB 2.x.What about EJB 3.x .I dint found it mentioned anywhere ???

Regards,
Shroff.
 
Creator of Enthuware JWS+ V6
Posts: 3220
283
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sagar,

If you are going to do the EE6 version of the EJB exam: skip all the paragraphs concerning EJB2.x.

Regards,
Frits
 
Sagar Shroff
Ranch Hand
Posts: 209
Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Frits Walraven wrote:Hi Sagar,

If you are going to do the EE6 version of the EJB exam: skip all the paragraphs concerning EJB2.x.

Regards,
Frits



Just wanted to know their thought process behind it ....just out of curiosity
 
You can't have everything. Where would you put it?
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!