Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB remote interface and bean implementation

 
Ray Ye
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which one of the following is the result of attempting to deploy a stateless session bean and execute one of the method M when the bean implementation contains the method M NOT defined in the remote interface?
a Compile time error for remote interface
b Compile time error for bean implementation
c Compile time error during stub/skeleton generation
d Code will compile without errors.
e Compile time error for home interface

Since bean implementation class does not implement remote interface (business interface) directly, in this case, I think d is right. But if the client (of this session bean) calls M method, the compiling error should arise. Since the remote interface does not define M method. Is my understanding right?

But if this is the case, should not the bean compiling tool should catch this kind of warning/error?
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The bean can contain methods not declared in the remote interface. This is perfectly okay although there is no way to get to those methods through the remote interface. Remember that the clients can only talk to the bean using its remote interface.

So in your scenario, you should get a compilation error( in the client code) when you attempt to invoke the method, because it is simply not a part of the method.

HTH
 
Ray Ye
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ajith, that is what I think.

However, it seems there is no "correct" compiling error given in this case, since the compiling error should be generated on the client (calling) code.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic