| CONTENTS |PREV |NEXT | Java Remote Method Invocation |
RMIFailureHandler Interfacejava.rmi.server.RMIFailureHandler interface provides amethod for specifying how the RMI runtime should respond whenserver socket creation fails (except during object export).package java.rmi.server;public interface RMIFailureHandler { public boolean failure(Exception ex);} Thefailuremethod is invoked with the exception that prevented the RMI runtimefrom creating ajava.net.ServerSocket. The methodreturnstrue if the runtime should attempt to retryandfalse otherwise. Before this method canbe invoked, a failure handler needs to be registered via theRMISocketFactory.setFailureHandler call. If thefailure handler is not set, the RMI runtime attempts to re-createtheServerSocket after waiting for a short period oftime.
Note that theRMIFailureHandler is not called whenServerSocket creation fails upon initial export of theobject. TheRMIFailureHandler will be called whenthere is an attempt to create aServerSocket after afailed accept on thatServerSocket.