Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

web & application server

 
John Pradeep.v
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I am new to Jboss... i am trying to understand the high level architecture of Jboss to start with, what i understood is that Jboss integrates tomcat into Jboss as a service to support web applications. But i do want to understand how does a web application deployed in tomcat (jboss service) can identify and interact with the EJBs deployed separately on the same Jboss server.
What would happen if i use EJB annotations like "@Resource" in classes present in the web application? since the tomcat will have its own class loader structure, how does the dependency injection will work for the classes present in the web application (loaded by tomcat) when we try to inject EJBs?

Another question - how does the web server generally interact with the application sever? is it always through sockets? or is it different for different types of EJBs (local & remote)?


Thanks
John
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you use @Resource (or @EJB) in your web app, JBoss AS gives you a proxy object for the referenced object. Elsewhere, JBoss AS instantiates the EJB. When your web app makes method calls on the EJB, the call is handled by the proxy and passed to the EJB. If the EJB is @Local, this is usally suimpky a pointer handoff. If the EJB is @Remote this might involve marshaling and unmarshaliing the parameters and return value but usually JBioss AS is smart enough to see that the web app and servelet are running in the same JVM and thus handles it like @Local.

If you need more detail than that, Jaikiran will have to provide it - he works on the EJB team and can provide specifics (and also tell you where I am wrong...)
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter's right (nothing new about that ) on how the EJB container and the web container work internally.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic