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