Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Kyle Help

 
Rohit Ahuja
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I have always wanted to have a neighbor just like you - Fred Rogers. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!