1. /*
  2. * @(#)StubDelegate.java 1.14 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. /*
  8. * Licensed Materials - Property of IBM
  9. * RMI-IIOP v1.0
  10. * Copyright IBM Corp. 1998 1999 All Rights Reserved
  11. *
  12. * US Government Users Restricted Rights - Use, duplication or
  13. * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  14. */
  15. package javax.rmi.CORBA;
  16. import java.io.IOException;
  17. import java.io.ObjectInputStream;
  18. import java.io.ObjectOutputStream;
  19. import java.rmi.RemoteException;
  20. import org.omg.CORBA.ORB;
  21. /**
  22. * Supports delegation for method implementations in {@link Stub}.
  23. * A delegate is an instance of a class that implements this
  24. * interface and provides a replacement implementation for all the
  25. * methods of <code>javax.rmi.CORBA.Stub</code>. If delegation is
  26. * enabled, each stub has an associated delegate.
  27. *
  28. * Delegates are enabled by providing the delegate's class name as the
  29. * value of the
  30. * <code>javax.rmi.CORBA.StubClass</code>
  31. * system property.
  32. *
  33. * @see Stub
  34. */
  35. public interface StubDelegate {
  36. /**
  37. * Delegation call for {@link Stub#hashCode}.
  38. */
  39. int hashCode(Stub self);
  40. /**
  41. * Delegation call for {@link Stub#equals}.
  42. */
  43. boolean equals(Stub self, java.lang.Object obj);
  44. /**
  45. * Delegation call for {@link Stub#toString}.
  46. */
  47. String toString(Stub self);
  48. /**
  49. * Delegation call for {@link Stub#connect}.
  50. */
  51. void connect(Stub self, ORB orb)
  52. throws RemoteException;
  53. // _REVISIT_ cannot link to Stub.readObject directly... why not?
  54. /**
  55. * Delegation call for
  56. * <a href="{@docRoot}/serialized-form.html#javax.rmi.CORBA.Stub"><code>Stub.readObject(java.io.ObjectInputStream)</code></a>.
  57. */
  58. void readObject(Stub self, ObjectInputStream s)
  59. throws IOException, ClassNotFoundException;
  60. // _REVISIT_ cannot link to Stub.writeObject directly... why not?
  61. /**
  62. * Delegation call for
  63. * <a href="{@docRoot}/serialized-form.html#javax.rmi.CORBA.Stub"><code>Stub.writeObject(java.io.ObjectOutputStream)</code></a>.
  64. */
  65. void writeObject(Stub self, ObjectOutputStream s)
  66. throws IOException;
  67. }