1. /*
  2. * @(#)UtilDelegate.java 1.15 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.Serializable;
  17. import java.rmi.Remote;
  18. import java.rmi.RemoteException;
  19. import javax.rmi.CORBA.Tie;
  20. import javax.rmi.CORBA.ValueHandler;
  21. import org.omg.CORBA.ORB;
  22. import org.omg.CORBA.portable.InputStream;
  23. import org.omg.CORBA.portable.OutputStream;
  24. import org.omg.CORBA.SystemException;
  25. /**
  26. * Supports delegation for method implementations in {@link Util}. The
  27. * delegate is a singleton instance of a class that implements this
  28. * interface and provides a replacement implementation for all the
  29. * methods of <code>javax.rmi.CORBA.Util</code>.
  30. *
  31. * Delegation is enabled by providing the delegate's class name as the
  32. * value of the
  33. * <code>javax.rmi.CORBA.UtilClass</code>
  34. * system property.
  35. *
  36. * @see Util
  37. */
  38. public interface UtilDelegate {
  39. /**
  40. * Delegation call for {@link Util#mapSystemException}.
  41. */
  42. RemoteException mapSystemException(SystemException ex);
  43. /**
  44. * Delegation call for {@link Util#writeAny}.
  45. */
  46. void writeAny(OutputStream out, Object obj);
  47. /**
  48. * Delegation call for {@link Util#readAny}.
  49. */
  50. java.lang.Object readAny(InputStream in);
  51. /**
  52. * Delegation call for {@link Util#writeRemoteObject}.
  53. */
  54. void writeRemoteObject(OutputStream out, Object obj);
  55. /**
  56. * Delegation call for {@link Util#writeAbstractObject}.
  57. */
  58. void writeAbstractObject(OutputStream out, Object obj);
  59. /**
  60. * Delegation call for {@link Util#registerTarget}.
  61. */
  62. void registerTarget(Tie tie, Remote target);
  63. /**
  64. * Delegation call for {@link Util#unexportObject}.
  65. */
  66. void unexportObject(Remote target) throws java.rmi.NoSuchObjectException;
  67. /**
  68. * Delegation call for {@link Util#getTie}.
  69. */
  70. Tie getTie(Remote target);
  71. /**
  72. * Delegation call for {@link Util#createValueHandler}.
  73. */
  74. ValueHandler createValueHandler();
  75. /**
  76. * Delegation call for {@link Util#getCodebase}.
  77. */
  78. String getCodebase(Class clz);
  79. /**
  80. * Delegation call for {@link Util#loadClass}.
  81. */
  82. Class loadClass(String className, String remoteCodebase, ClassLoader loader)
  83. throws ClassNotFoundException;
  84. /**
  85. * Delegation call for {@link Util#isLocal}.
  86. */
  87. boolean isLocal(Stub stub) throws RemoteException;
  88. /**
  89. * Delegation call for {@link Util#wrapException}.
  90. */
  91. RemoteException wrapException(Throwable obj);
  92. /**
  93. * Delegation call for {@link Util#copyObject}.
  94. */
  95. Object copyObject(Object obj, ORB orb) throws RemoteException;
  96. /**
  97. * Delegation call for {@link Util#copyObjects}.
  98. */
  99. Object[] copyObjects(Object[] obj, ORB orb) throws RemoteException;
  100. }