The reason I did't do that is because I read some strange
rules in the EJB spec about bean instances getting discarded
when checked exception are thrown. I probably totally
misunderstood those rules, but I understood that there are
lifecycle issues related to throwing the various kinds of
exceptions. RemoteException seemed to be the most convenient
way to go. By the way, how does RMI get checked exceptions
across the wire? I thought they were wrapped in the skeleton
and unwrapped in the stub, hence my previous comment on wrapping
exceptions in RemoteException.
Frank
-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of Rickard �berg
Sent: Thursday, November 18, 1999 10:17 AM
To: [EMAIL PROTECTED]
Subject: Re: Remote Interface Question
Hi!
Frank Sauer wrote:
> You're right, it doesn't have to throw RemoteException, but it can't
> throw any other exceptions either. I always thought (correct me if I'm
> wrong) that the implementation could throw any exception which in turn
> would get wrapped in a RemoteException for transport to the client. But
> if my interface only specifies RemoteException, then that's the only one
> I'm allowed to throw. Is that correct?
That doesn't make much sense to me. Yes, if RemoteException is the only
defined exception in a throws clause then that is the only type of
exception that can be thrown.
But, if you need application exception (=checked exceptions), why don't
you simply add these to the throws clause in the remote interface?
Interfaces is a means to define a contract. If you ignore that contract
by throwing RemoteExceptions which wrap other exceptions you don't gain
any extra information from the interface (as far as exceptions are
concerned).
Why would you want to have such a design/implementation??
/Rickard
--
Rickard �berg
@home: +46 13 177937
Email: [EMAIL PROTECTED]
Homepage: http://www-und.ida.liu.se/~ricob684
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".