• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Rules for component interface and home interface

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The book Head First EJB says

Rules for the remote home interface
...
Declare one or more home business methods
�Arguments and return types must be RMI-IIOP compatible
�You can have overloaded methods
�Each method must declare a RemoteException
�You can declare your own application exceptions, but they must NOT be runtime exceptions (they must be compiler-checked exceptions)
�Methods can have arbitrary names, as long as they don�t begin with �create�, �find�, or �remove�.



Why can't I start a home business method with "remove"?

The book Head First EJB says also says :

Rules for the remote component interface
...
Declare one or more business methods that throw a RemoteException
�Arguments and return types must be RMI-IIOP compatible (Serializable, primitive, Remote, or arrays or collections of any of those)
�You can have overloaded methods
�Each method must declare a RemoteException
�You can declare your own application exceptions, but they must NOT be runtime exceptions (they must be compiler-checked exceptions � subclasses of Exception, but not subclasses of RuntimeExcepton)
�Methods can have arbitrary names, as long as they don�t begin with �ejb�.



Is it allowed to start a business method with "remove"?
 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your first question - home interface already has remove methods(one for session, one for entity) so what else do you want to remove? Message bean ? MDB doesn't have a home.

Your second question - I guess you might be able to declare a method that starts with 'remove' in component interface since it doesn't violate the rule. But again, it alreday has a remove method in component. Why do you need other remove methods?

Shiang
 
This parrot is no more. It has ceased to be. Now it's a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic