KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > rmi > CORBA > ValueHandler


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
16 package javax.rmi.CORBA;
17
18 /**
19  * Defines methods which allow serialization of Java objects
20  * to and from GIOP streams.
21  **/

22 public interface ValueHandler {
23
24     /**
25      * Writes a value to the stream using Java semantics.
26      * @param out the stream to write the value to.
27      * @param value the value to be written to the stream.
28      **/

29     void writeValue(org.omg.CORBA.portable.OutputStream JavaDoc out,
30             java.io.Serializable JavaDoc value);
31
32     /**
33      * Reads a value from the stream using Java semantics.
34      * @param in the stream to read the value from.
35      * @param offset the current position in the input stream.
36      * @param clz the type of the value to be read in.
37      * @param repositoryID the RepositoryId of the value to be read in.
38      * @param sender the sending context runtime codebase.
39      * @return the value read from the stream.
40      **/

41     java.io.Serializable JavaDoc readValue(org.omg.CORBA.portable.InputStream JavaDoc in,
42                    int offset,
43                    java.lang.Class JavaDoc clz,
44                    String JavaDoc repositoryID,
45                    org.omg.SendingContext.RunTime JavaDoc sender);
46
47     /**
48      * Returns the CORBA RepositoryId for the given Java class.
49      * @param clz a Java class.
50      * @return the CORBA RepositoryId for the class.
51      **/

52     java.lang.String JavaDoc getRMIRepositoryID(java.lang.Class JavaDoc clz);
53
54     /**
55      * Indicates whether the given class performs custom or
56      * default marshaling.
57      * @param clz the class to test for custom marshaling.
58      * @return <code>true</code> if the class performs custom marshaling, <code>false</code>
59      * if it does not.
60      **/

61     boolean isCustomMarshaled(java.lang.Class JavaDoc clz);
62
63     /**
64      * Returns the CodeBase for this ValueHandler. This is used by
65      * the ORB runtime. The server sends the service context containing
66      * the IOR for this CodeBase on the first GIOP reply. The client
67      * does the same on the first GIOP request.
68      * @return the SendingContext.CodeBase of this ValueHandler.
69      **/

70     org.omg.SendingContext.RunTime JavaDoc getRunTimeCodeBase();
71
72     /**
73      * If the value contains a <code>writeReplace</code> method then the result
74      * is returned. Otherwise, the value itself is returned.
75      * @param value the value to be marshaled.
76      * @return the true value to marshal on the wire.
77      **/

78     java.io.Serializable JavaDoc writeReplace(java.io.Serializable JavaDoc value);
79
80 }
81
Popular Tags