• Post Reply Bookmark Topic Watch Topic
  • New Topic

Passing a Session Bean's Object Reference  RSS feed

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,folks
Can you explain me the following statement:
You can't pass the "this" reference because the session bean is not a remote object.
thanks in advance
 
George Brown
Ranch Hand
Posts: 919
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, don't quote me on this, but this is my guess...
javax.ejb.EJBObject subclasses java.rmi.Remote .
Your Session Bean subclasses javax.ejb.EJBObject .
java.rmi.Remote serves to identify interfaces whose methods may be invoked from a non-local virtual machine.
java.rmi.server.RemoteObject subclasses java.rmi.Remote and java.io.Serializable .
If I am not mistaken (and please correct me if I am) java.rmi.server.RemoteObject is the basis for optionally chucking objects around with RMI, which is possible due to the Serializable interface.
If the compiler thinks that you are trying to pass the session bean around, out of its container, and on the wire, it would make sure that this message is generated.
 
George Brown
Ranch Hand
Posts: 919
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
further to that, from the ejb 1.1 spec...

i hope that helps.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!