RepositoryHelper.java revision 608:7e06bf1dcb09
1/*
2 * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.  Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.org.omg.CORBA;
26
27public final class RepositoryHelper
28{
29    private static String  _id = "IDL:com.sun.omg.org/CORBA/Repository:3.0";
30
31    public RepositoryHelper()
32    {
33    }
34
35    public static void insert (org.omg.CORBA.Any a, Repository that)
36    {
37        org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
38        a.type (type ());
39        write (out, that);
40        a.read_value (out.create_input_stream (), type ());
41    }
42
43    public static Repository extract (org.omg.CORBA.Any a)
44    {
45        return read (a.create_input_stream ());
46    }
47
48    private static org.omg.CORBA.TypeCode __typeCode = null;
49    synchronized public static org.omg.CORBA.TypeCode type ()
50    {
51        if (__typeCode == null)
52            {
53                __typeCode = org.omg.CORBA.ORB.init ().create_string_tc (0);
54                __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.org.omg.CORBA.RepositoryHelper.id (), "Repository", __typeCode);
55            }
56        return __typeCode;
57    }
58
59    public static String id ()
60    {
61        return _id;
62    }
63
64    public static Repository read (org.omg.CORBA.portable.InputStream istream)
65    {
66        String value = null;
67        value = istream.read_string ();
68        return null;
69    }
70
71    public static void write (org.omg.CORBA.portable.OutputStream ostream, Repository value)
72    {
73        ostream.write_string (null);
74    }
75
76}
77