• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can i write C++ component in j2ee  RSS feed

 
Shiv Sidhaarth
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys and Gals,
I have one general question. I can uderstand that EJB is specification. Then, it should mean that i can implement that in any language. Can i write C++ component which satisfies EJB sepcification. Or component in any language other than java, for that matter. If so, can i use that component along with java components in J2EE compliant server?
Thanks in advance,
Sankar
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nope. The emphasis in the words are on the "Java" part, not the "Enterprise" part. Most of the EJB spec has to do with how interpreted Java code works in a framework of other interpreted Java code -- reinventing that in another language environment would be equivalent to reinventing the entire Java experience.
Also, part of the EJB spec is that in order to be "write-once, use-anywhere" you are explicitly forbidden to invoke "native code", so that ends the whole idea at the start.
However, there is certainly a place for non-Java and Java code to live together happily in the same world - it's called CORBA.
 
Jorge Phillips
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJB containers run a Java VM so you can't run compiled C++ in the container. Even if you could (assuming a .net like C++ to JVM compiled code) your C++ objects would still have to satisfy the container contracts. Major changes would be needed in the EJB environment to accomodate this.
But you can create a C++ component accessible from your EJB application via RMI-IIOP. You would have to deploy this foreign component using CORBA and generate the corresponding IDL interfaces for both sides so they can interoperate.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!