1. /*
  2. * @(#)ServerRef.java 1.13 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. import java.rmi.*;
  12. /**
  13. * A ServerRef represents the server-side handle for a remote object
  14. * implementation.
  15. *
  16. * @version 1.13, 02/02/00
  17. * @author Ann Wollrath
  18. * @since JDK1.1
  19. */
  20. public interface ServerRef extends RemoteRef {
  21. /** indicate compatibility with JDK 1.1.x version of class. */
  22. static final long serialVersionUID = -4557750989390278438L;
  23. /**
  24. * Creates a client stub object for the supplied Remote object.
  25. * If the call completes successfully, the remote object should
  26. * be able to accept incoming calls from clients.
  27. * @param obj the remote object implementation
  28. * @param data information necessary to export the object
  29. * @return the stub for the remote object
  30. * @exception RemoteException if an exception occurs attempting
  31. * to export the object (e.g., stub class could not be found)
  32. * @since JDK1.1
  33. */
  34. RemoteStub exportObject(Remote obj, Object data)
  35. throws RemoteException;
  36. /**
  37. * Returns the hostname of the current client. When called from a
  38. * thread actively handling a remote method invocation the
  39. * hostname of the client is returned.
  40. * @return the client's host name
  41. * @exception ServerNotActiveException if called outside of servicing
  42. * a remote method invocation
  43. * @since JDK1.1
  44. */
  45. String getClientHost() throws ServerNotActiveException;
  46. }