KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > omg > CORBA > ValueBaseHelper


1 /*
2  * @(#)ValueBaseHelper.java 1.12 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  /**
9  * The Helper for <tt>ValueBase</tt>. For more information on
10  * Helper files, see <a HREF="doc-files/generatedfiles.html#helper">
11  * "Generated Files: Helper Files"</a>.<P>
12  */

13  
14 /*
15  * @(#)ValueBaseHelper.java 1.12 03/12/19
16  */

17 /*
18  * Licensed Materials - Property of IBM
19  * RMI-IIOP v1.0
20  * Copyright IBM Corp. 1998 1999 All Rights Reserved
21  *
22  * US Government Users Restricted Rights - Use, duplication or
23  * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
24  */

25
26 package org.omg.CORBA;
27
28 abstract public class ValueBaseHelper
29 {
30     private static String JavaDoc _id = "IDL:omg.org/CORBA/ValueBase:1.0";
31
32     public static void insert (org.omg.CORBA.Any JavaDoc a, java.io.Serializable JavaDoc that)
33     {
34     org.omg.CORBA.portable.OutputStream JavaDoc out = a.create_output_stream ();
35     a.type (type ());
36     write (out, that);
37     a.read_value (out.create_input_stream (), type ());
38     }
39
40     public static java.io.Serializable JavaDoc extract (org.omg.CORBA.Any JavaDoc a)
41     {
42     return read (a.create_input_stream ());
43     }
44
45     private static org.omg.CORBA.TypeCode JavaDoc __typeCode = null;
46     synchronized public static org.omg.CORBA.TypeCode JavaDoc type ()
47     {
48     if (__typeCode == null)
49         {
50         __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (TCKind.tk_value);
51         }
52     return __typeCode;
53     }
54
55     public static String JavaDoc id ()
56     {
57     return _id;
58     }
59
60     public static java.io.Serializable JavaDoc read (org.omg.CORBA.portable.InputStream JavaDoc istream)
61     {
62     return ((org.omg.CORBA_2_3.portable.InputStream JavaDoc)istream).read_value ();
63     }
64
65     public static void write (org.omg.CORBA.portable.OutputStream JavaDoc ostream, java.io.Serializable JavaDoc value)
66     {
67     ((org.omg.CORBA_2_3.portable.OutputStream JavaDoc)ostream).write_value (value);
68     }
69
70
71 }
72
Popular Tags