File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and Other Java EE Technologies and the fly likes Kyle Help Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » EJB and Other Java EE Technologies
Reply Bookmark "Kyle Help" Watch "Kyle Help" New topic
Author

Kyle Help

Deepak A
Ranch Hand

Joined: Oct 04, 2001
Posts: 120
Hi Kyle,
Deepak here,well i am an infant to ejbs,yet i have a set of questions.
1. i dont find create method anywhere in the documentation.where can i find the create and ejbcreate method??
2. in rmi we use a single interface named remote,whereas in ejbs we use two methods,remote and home,why has the home interface been introduced, i mean it would have been a better idea to use a single interface.
Anyone who can help,please do,
thanx,deepak.


Face Off.
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3878
Originally posted by Deepak a:
Hi Kyle,
Deepak here,well i am an infant to ejbs,yet i have a set of questions.
1. i dont find create method anywhere in the documentation.where can i find the create and ejbcreate method??
2. in rmi we use a single interface named remote,whereas in ejbs we use two methods,remote and home,why has the home interface been introduced, i mean it would have been a better idea to use a single interface.
Anyone who can help,please do,
thanx,deepak.

The two questions are closely related. Let's start with RMI. In RMI you had to write special code to create your remote objects and register them with the naming service. This sort of code was always a source of errors. The major problem has to deal with the management of remote objects -- when they're created, when they're destroyed, etc.
In CORBA this was described through what was called the Lifecycle service. It basically said that Remote objects needed a special "factory" to create them and find them if they were already created, etc.
The Home interface is basically specifying an object factory. Homes are automatically registered with the JNDI naming service -- you don't have to write code to do that. Home interfaces define create() methods. The method signature for a create() method is create() with some set of parameters (e.g. String foo, int bar).
For each create() method in your home interface, your bean implementation class must define a matching ejbCreate() method with the same parameter set.
The EJB container will automatically generate an implementation of your home interface, and will make sure that when you send a create() method to a home, that a bean instance will be selected (or created) and that the corresponding ejbCreate() method will be sent to that bean.
For more information, read my book, or Richard Monson-Haefel's book. They both cover this in great detail.
Kyle

------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
 
 
subject: Kyle Help
 
Threads others viewed
getEJBObject method
EJB Beginner
can client able to call EJB directly
choosing between home business methods and finders
Local and remote interfaces for session facade?
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture