File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes EJB Interfaces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB Interfaces" Watch "EJB Interfaces" New topic

EJB Interfaces

Mark Herschberg

Joined: Dec 04, 2000
Posts: 6037
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 Savory
Ranch Hand

Joined: Feb 08, 2001
Posts: 122
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

Joined: Mar 10, 2001
Posts: 176
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 ..

I agree. Here's the link:
subject: EJB Interfaces
It's not a secret anymore!