• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

figure: Structure of an ejb-jar Pg624

 
Sudhir V
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The figure shows that the ejb-jar shud have the Advice.class and AdviceHome.class. But the spec says that container implemented classes shud not be kept in the jar file.
So I think the figure shud say Advice and AdviceHome interfaces.
 
ShwetaJava Agarwal
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Advice.class and AdviceHome.class are not container implemented classes.
By container implemented classes spec means that classes genertared by container which implements EJBObject and EJBHome interface.
Stub sud also not included in the jar.
 
Sudhir V
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Swetha!!!
But I thought that we just wrote the interfaces and its the container's business to write classes implementing those interfaces. So the .class files are created by the container. Thats what HFE Pg 87-88 says. It says "Container has to write the class that implements your component interface and has to make the stub that goes with that EJBObject"
Even spec24.3 bullet point 2 says "The Enterprise bean home, component and/or web service endpoint interfaces" not the class files.
[ February 05, 2004: Message edited by: Sudhir ]
 
Keith Rosenfield
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sudhir,
I think I know where your confusion lies. The .class files that you include in the ejb-jar are the compiled INTERFACES. Don't assume that because a file has a .class extension that it is an implementation class. The container is responsible for creating the classes that implement those INTERFACES.
Advice.class and AdviceHome.class are the compiled ITERFACES that you wrote. The container will implement these interfaces with concrete classes.
Hope this helps.
 
Sudhir V
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oooooooooook now it makes sense. I was confused by the .class syndrome. Now it makes sense. Thanks Keith and Swetha.
 
Kathy Sierra
Cowgirl and Author
Rancher
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sudhir:
Oooooooooook now it makes sense. I was confused by the .class syndrome. Now it makes sense. Thanks Keith and Swetha.

The .class syndrome gets everyone
Our brains are so stuck on the differences between classes and interfaces, but as Keith pointed out -- they're all .class files in the end
cheers,
Kathy
 
Keith Rosenfield
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WOW...I never knew that such a syndrome exists.
Glad it didn't get me..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic