1. /*
  2. * @(#)RMIClientSocketFactory.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>RMIClientSocketFactory</code> instance is used by the RMI runtime
  12. * in order to obtain client sockets for RMI calls. A remote object can be
  13. * associated with an <code>RMIClientSocketFactory</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>RMIClientSocketFactory</code> instance associated with a remote
  19. * object will be downloaded to clients when the remote object's reference is
  20. * transmitted in an RMI call. This <code>RMIClientSocketFactory</code> will
  21. * be used to create connections to the remote object for remote method calls.
  22. *
  23. * <p>An <code>RMIClientSocketFactory</code> instance can also be associated
  24. * with a remote object registry so that clients can use custom socket
  25. * communication with a remote object registry.
  26. *
  27. * <p>An implementation of this interface should be serializable and
  28. * should implement {@link Object#equals} to return <code>true</code> when
  29. * passed an instance that represents the same (functionally equivalent)
  30. * client socket factory, and <code>false</code> otherwise (and it should also
  31. * implement {@link Object#hashCode} consistently with its
  32. * <code>Object.equals</code> implementation).
  33. *
  34. * @version 1.11, 12/19/03
  35. * @author Ann Wollrath
  36. * @author Peter Jones
  37. * @since 1.2
  38. * @see java.rmi.server.UnicastRemoteObject
  39. * @see java.rmi.activation.Activatable
  40. * @see java.rmi.registry.LocateRegistry
  41. */
  42. public interface RMIClientSocketFactory {
  43. /**
  44. * Create a client socket connected to the specified host and port.
  45. * @param host the host name
  46. * @param port the port number
  47. * @return a socket connected to the specified host and port.
  48. * @exception IOException if an I/O error occurs during socket creation
  49. * @since 1.2
  50. */
  51. public Socket createSocket(String host, int port)
  52. throws IOException;
  53. }