• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

home methods

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
If there is a method in the bean class. Under what circumstances would we consider to make it available as part of the home interface?
I happend to come across an example where a findby method is made available through the homeinterface. Usually methods that are meant to be used by the clients are made available through the remote interface.
I would appreciate if any one clears my doubt.
thanks
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Here is what I understand: The Home interface provides methods for clients to get a hold of an EJB. Either by creating new ones, or finding existing ones.

Once you then have an entity bean reference, you can use the Remote interface to run business methods on them.
 
Ranch Hand
Posts: 1157
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ajit,
You can only define finder and create methods in the HomeInterface.
The primary purpose of the HomeObject is to act as a factory for the EJBObject.So it needs to have method/responsibities to make available the EJBObject instances to the client - The EJB specs stipulates the finder and the create methods as the only means to do it.
Hope this helps.
Regards,
------------------
Sandeep

  • Sun Certified Programmer for Java 2 Platform Scored 93 per cent
  • Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java Scored 56 out of 59
  • IBM Enterprise Connectivity with J2EE Scored 72 per cent
  • Enterprise Development on the Oracle Internet Platform Scored 44 out of 56
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are also methods referred to as "home methods" in the home interface (sorry if the term is confusing). These can be used when a particular bean reference is not needed to do the work, kind of like a static method of a class. These methods names should NOT start with "find" or "create". They also will have a corresponding ejbHomeXXX method in the bean class. So for example, if I have a method in my home interface called getSomeStuff(), I would have a method in the bean class called ejbHomeGetSomeStuff(). This is probably not what you are looking for, but you should be aware that it is available. It's in the EJB 2.0 spec, if you want to read up on it.
 
Villains always have antidotes. They're funny that way. Here's an antidote disguised as a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic