Invoke the given method against a remote server. If the call results
in certain
RemoteException subtypes, catch the exception and
attempt to fail over to another server.
Failover will only be attempted if the remote call throws an exception
whose type indicates the call never reached the server:
-
java.rmi.ConnectException
-
java.rmi.ConnectIOException
-
java.rmi.NoSuchObjectException
-
java.rmi.UnknownHostException
All other exception types will not be caught.
If one of the above exception types is caught when invoking against the
last known server, then a
RemoteException will be thrown. This
exception will include as its
Throwable#getCause() either
- any
java.rmi.NoSuchObjectException that was caught
- or, if no
java.rmi.NoSuchObjectException that was caught,
the exception thrown on the last failover attempt
Preference is given to including
NoSuchObjectException
as
the cause, as that exception indicates that a server was listening on
the expected address and port but that this client has an RMI stub that
is out of sync with the server. This would typically happen due to
a server restart or service redeploy. Knowledge of this failure condition
could potentially be useful to the caller.