1. /*
  2. * @(#)RMIServerSocketFactory.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. import java.io.*;
  9. import java.net.*;
  10. /**
  11. * An <code>RMIServerSocketFactory</code> instance is used by the RMI runtime
  12. * in order to obtain server sockets for RMI calls. A remote object can be
  13. * associated with an <code>RMIServerSocketFactory</code> when it is
  14. * created/exported via the constructors or <code>exportObject</code> methods
  15. * of <code>java.rmi.server.UnicastRemoteObject</code> and
  16. * <code>java.rmi.activation.Activatable</code> .
  17. *
  18. * <p>An <code>RMIServerSocketFactory</code> instance associated with a remote
  19. * object is used to obtain the <code>ServerSocket</code> used to accept
  20. * incoming calls from clients.
  21. *
  22. * <p>An <code>RMIServerSocketFactory</code> instance can also be associated
  23. * with a remote object registry so that clients can use custom socket
  24. * communication with a remote object registry.
  25. *
  26. * <p>An implementation of this interface
  27. * should implement {@link Object#equals} to return <code>true</code> when
  28. * passed an instance that represents the same (functionally equivalent)
  29. * server socket factory, and <code>false</code> otherwise (and it should also
  30. * implement {@link Object#hashCode} consistently with its
  31. * <code>Object.equals</code> implementation).
  32. *
  33. * @version 1.11, 12/19/03
  34. * @author Ann Wollrath
  35. * @author Peter Jones
  36. * @since 1.2
  37. * @see java.rmi.server.UnicastRemoteObject
  38. * @see java.rmi.activation.Activatable
  39. * @see java.rmi.registry.LocateRegistry
  40. */
  41. public interface RMIServerSocketFactory {
  42. /**
  43. * Create a server socket on the specified port (port 0 indicates
  44. * an anonymous port).
  45. * @param port the port number
  46. * @return the server socket on the specified port
  47. * @exception IOException if an I/O error occurs during server socket
  48. * creation
  49. * @since 1.2
  50. */
  51. public ServerSocket createServerSocket(int port)
  52. throws IOException;
  53. }