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?

Frank

-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of Rickard �berg
Sent: Wednesday, November 17, 1999 7:32 AM
To: [EMAIL PROTECTED]
Subject: Re: Remote Interface Question


Hey

Frank Sauer wrote:
> That's right.
> There is one often overlooked issue with this approach though.
> The business methods in the remote interface must all throw
> RemoteException per EJB spec, but the implementation doesn't have to.
>
> Except when you use this pattern, now the impl implements the business
> interface and must all of a sudden also throw the RemoteException
> and it cannot throw exceptions not specified in the business interface.

Your above comment is incorrect. The throws clause of method in an
interface-implementation must be a subset of the interface throws
clause, i.e. it may be null.

Suggestion: in order to use the type checking that interface
implementation gives you, you should divide the interface into two: one
which only contains the business methods, and one which extends the
first interface and EJBObject. Your bean implementation may now
implement the business interface without risk of using "this" properly,
and you do not need to implement dummy methods for EJBObject method
declarations.

/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".

Reply via email to