If I override the 3 methods in EJB3 session bean class (not as business
methods), they are ignored when a client call the 3 methods on a bean
remote reference. It seems the 3 methods are invoked on the stubs only,
with no remote calls. A toString() call gets this:
com.me.test._NoMethodIF_Wrapper_at_a725afc8
If I override and implement Object.toString() as a business method, my
implementation is still ignored, but the call is progagated remotely.
For example:
@Stateless()
public class NoMethodBean implements NoMethodIF {
public String toString() {
return "This is an bean with business interface: " +
NoMethodIF.class.getName();
}
But the actual output in the client is:
com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate_at_2f4aea
Is it allowed to declare those public methods in java.lang.Object
(hashCode, equals, toString, wait, notify, finalize) as business
methods? Most of them shouldn't be used as business methods, so as not
to interfere with container management. But it seems reasonable to
overide toString() as business method, just to return better descriptions.
--
Cheng