KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > impl > corba > TypeCodeImplHelper


1 /*
2  * @(#)TypeCodeImplHelper.java 1.13 04/06/21
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 com.sun.corba.se.impl.corba;
17
18 abstract public class TypeCodeImplHelper
19 {
20     private static String JavaDoc _id = "IDL:omg.org/CORBA/TypeCode:1.0";
21
22     public static void insert (org.omg.CORBA.Any JavaDoc a, org.omg.CORBA.TypeCode JavaDoc that)
23     {
24     org.omg.CORBA.portable.OutputStream JavaDoc out = a.create_output_stream ();
25     a.type (type ());
26     write (out, that);
27     a.read_value (out.create_input_stream (), type ());
28     }
29
30     public static org.omg.CORBA.TypeCode JavaDoc extract (org.omg.CORBA.Any JavaDoc a)
31     {
32     return read (a.create_input_stream ());
33     }
34
35     private static org.omg.CORBA.TypeCode JavaDoc __typeCode = null;
36     synchronized public static org.omg.CORBA.TypeCode JavaDoc type ()
37     {
38     if (__typeCode == null)
39         {
40         __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_TypeCode);
41         }
42     return __typeCode;
43     }
44
45     public static String JavaDoc id ()
46     {
47     return _id;
48     }
49
50     public static org.omg.CORBA.TypeCode JavaDoc read (org.omg.CORBA.portable.InputStream JavaDoc istream)
51     {
52     return istream.read_TypeCode ();
53     }
54
55     public static void write (org.omg.CORBA.portable.OutputStream JavaDoc ostream, org.omg.CORBA.TypeCode JavaDoc value)
56     {
57     ostream.write_TypeCode (value);
58     }
59
60     public static void write (org.omg.CORBA.portable.OutputStream JavaDoc ostream, TypeCodeImpl value)
61     {
62     ostream.write_TypeCode (value);
63     }
64
65 }
66
Popular Tags