I could use some advice on a pattern to use to enable fault tolerance on the
client-side of the EJB scenario. My clients access session beans through a
Facade (FundBroker) interface that is implemented on my client by a class named
FundBrokerImpl.

If the client invokes a method in FundBrokerImpl, the method simply makes the
call against the appropriate session bean. If I receive a remote exception, I
attempt to resubmit the request a number of times before trying more drastic
actions. I understand that I could put the following code in all of my methods:

while (attempts < 3) {
    try {
        remote.getSomeValue();
        return;
    } catch (RemoteException rx) {
        attempts++;
    }
}
// handle fatal error

I want to use Dynamic Proxies in JDK 1.3 to leverage the proxy pattern so I can
eliminate some of the monotonous coding. I also want to eliminate the client
(but not this proxy) from dealing with any extreme fatal errors. Therefore, one
stipulation that I have is that the method signature in FundBroker cannot throw
a RemoteException.

FundBroker:     Value getSomeValue();

The problem is that the method signature in the implementation class also cannot
throw RemoteException. Unfortunately, this method will contain the call to the
remote ejb interface, which most certainly *will* throw RemoteException. Of
course, the compiler won't let this conflict pass unnoticed.

I know of several ways to get around this pattern without resorting to Dynamic
Proxies, but I was wondering if anyone can think of a way I can use this very
cool feature.

thanks,
jim

===========================================================================
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