• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Rules for component interface and home interface

 
Karin Paola Illuminate
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"?
 
Shiang Wang
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic