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