1. /*
  2. * @(#)RMIFailureHandler.java 1.8 00/02/02
  3. *
  4. * Copyright 1996-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.rmi.server;
  11. /**
  12. * An <code>RMIFailureHandler</code> can be registered via the
  13. * <code>RMISocketFactory.setFailureHandler</code> call. The
  14. * <code>failure</code> method of the handler is invoked when the RMI
  15. * runtime is unable to create a <code>ServerSocket</code> to listen
  16. * for incoming calls. The <code>failure</code> method returns a boolean
  17. * indicating whether the runtime should attempt to re-create the
  18. * <code>ServerSocket</code>.
  19. *
  20. * @author Ann Wollrath
  21. * @version @(#)RMIFailureHandler.java 1.8, 00/02/02
  22. * @since JDK1.1
  23. */
  24. public interface RMIFailureHandler {
  25. /**
  26. * The <code>failure</code> callback is invoked when the RMI
  27. * runtime is unable to create a <code>ServerSocket</code> via the
  28. * <code>RMISocketFactory</code>. An <code>RMIFailureHandler</code>
  29. * is registered via a call to
  30. * <code>RMISocketFacotry.setFailureHandler</code>. If no failure
  31. * handler is installed, the default behavior is to attempt to
  32. * re-create the ServerSocket.
  33. *
  34. * @param ex the exception that occurred during <code>ServerSocket</code>
  35. * creation
  36. * @return if true, the RMI runtime attempts to retry
  37. * <code>ServerSocket</code> creation
  38. * @see java.rmi.server.RMISocketFactory#setFailureHandler(RMIFailureHandler)
  39. * @since JDK1.1
  40. */
  41. public boolean failure(Exception ex);
  42. }