Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB Interfaces

 
Mark Herschberg
Sheriff
Posts: 6037
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I were to make a regular client server application, say over RMI, my server would expose certain APIs. How different are these APIs when implemented with EJBs? I'm wondering if most EJB implementations take extra parameters. Specifically, I'm thinking because many EJB servers are accessed through a web/servlet interface, that may cause extra parameters to be used, in the name of design and conveinence; but I'm wondering about any type of alteration.
For example, suppose I had some typical database application. My exposed methods might be as follows:

would EJB methods likely have addition paramters, e.g. HTTPSession values? If they do, are there still likely to be the "raw" EJBs without the source dependent parameters, floating around, and accessible on the EJB server?
My motivation is that I want to access EJBs from a custom client, and I'm wondering if there will be "legacy" complications. I've looked though Sun's Petshop example, and, at least in that example, the "source independent" EJBs exist and I can use them.

--Mark
hershey@vaultus.com
 
Mark Savory
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There would be no additional parameters that you would have to pass to the methods that you mentioned. The class that you create would have to implement a certain interface, for example SessionBean, so you'd have to code certain other methods like ejbCreate along with the methods you mentioned. The client would change in that it would have to access the home bean(container) via RMI and then use it to create a bean that has on it the methods you're interested in.
 
Madhu Juneja
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The methods that you have mentioned (are business methods) would be declared in the remote interface and defined in the Bean class.
You your current design is using servlets and if you are using the methods of HttpServletRequest and HttpSession, then may be you need to pass these as additional parameters. It depends ..

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic