1. /*
  2. * @(#)ValueHandler.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. /**
  17. * Defines methods which allow serialization of Java objects
  18. * to and from GIOP streams.
  19. **/
  20. public interface ValueHandler {
  21. /**
  22. * Writes a value to the stream using Java semantics.
  23. * @param out the stream to write the value to.
  24. * @param value the value to be written to the stream.
  25. **/
  26. void writeValue(org.omg.CORBA.portable.OutputStream out,
  27. java.io.Serializable value);
  28. /**
  29. * Reads a value from the stream using Java semantics.
  30. * @param in the stream to read the value from.
  31. * @param offset the current position in the input stream.
  32. * @param clz the type of the value to be read in.
  33. * @param repositoryID the RepositoryId of the value to be read in.
  34. * @param sender the sending context runtime codebase.
  35. * @return the value read from the stream.
  36. **/
  37. java.io.Serializable readValue(org.omg.CORBA.portable.InputStream in,
  38. int offset,
  39. java.lang.Class clz,
  40. String repositoryID,
  41. org.omg.SendingContext.RunTime sender);
  42. /**
  43. * Returns the CORBA RepositoryId for the given Java class.
  44. * @param clz a Java class.
  45. * @return the CORBA RepositoryId for the class.
  46. **/
  47. java.lang.String getRMIRepositoryID(java.lang.Class clz);
  48. /**
  49. * Indicates whether the given class performs custom or
  50. * default marshaling.
  51. * @param clz the class to test for custom marshaling.
  52. * @return <code>true</code> if the class performs custom marshaling, <code>false</code>
  53. * if it does not.
  54. **/
  55. boolean isCustomMarshaled(java.lang.Class clz);
  56. /**
  57. * Returns the CodeBase for this ValueHandler. This is used by
  58. * the ORB runtime. The server sends the service context containing
  59. * the IOR for this CodeBase on the first GIOP reply. The client
  60. * does the same on the first GIOP request.
  61. * @return the SendingContext.CodeBase of this ValueHandler.
  62. **/
  63. org.omg.SendingContext.RunTime getRunTimeCodeBase();
  64. /**
  65. * If the value contains a <code>writeReplace</code> method then the result
  66. * is returned. Otherwise, the value itself is returned.
  67. * @param value the value to be marshaled.
  68. * @return the true value to marshal on the wire.
  69. **/
  70. java.io.Serializable writeReplace(java.io.Serializable value);
  71. }