KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > excepiiop > interfaces > IdlExceptionHelper


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.test.excepiiop.interfaces;
23
24
25 /**
26 * org/jboss/test/excepiiop/interfaces/IdlExceptionHelper.java .
27 * Generated by the IDL-to-Java compiler (portable), version "3.1"
28 * from IdlException.idl
29 * Thursday, July 17, 2003 6:39:23 PM BRT
30 */

31
32 abstract public class IdlExceptionHelper
33 {
34   private static String JavaDoc _id = "IDL:org/jboss/test/excepiiop/interfaces/IdlException:1.0";
35
36   public static void insert (org.omg.CORBA.Any JavaDoc a, org.jboss.test.excepiiop.interfaces.IdlException that)
37   {
38     org.omg.CORBA.portable.OutputStream JavaDoc out = a.create_output_stream ();
39     a.type (type ());
40     write (out, that);
41     a.read_value (out.create_input_stream (), type ());
42   }
43
44   public static org.jboss.test.excepiiop.interfaces.IdlException extract (org.omg.CORBA.Any JavaDoc a)
45   {
46     return read (a.create_input_stream ());
47   }
48
49   private static org.omg.CORBA.TypeCode JavaDoc __typeCode = null;
50   private static boolean __active = false;
51   synchronized public static org.omg.CORBA.TypeCode JavaDoc type ()
52   {
53     if (__typeCode == null)
54     {
55       synchronized (org.omg.CORBA.TypeCode JavaDoc.class)
56       {
57         if (__typeCode == null)
58         {
59           if (__active)
60           {
61             return org.omg.CORBA.ORB.init().create_recursive_tc ( _id );
62           }
63           __active = true;
64           org.omg.CORBA.StructMember JavaDoc[] _members0 = new org.omg.CORBA.StructMember JavaDoc [2];
65           org.omg.CORBA.TypeCode JavaDoc _tcOf_members0 = null;
66           _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_long);
67           _members0[0] = new org.omg.CORBA.StructMember JavaDoc (
68             "i",
69             _tcOf_members0,
70             null);
71           _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0);
72           _members0[1] = new org.omg.CORBA.StructMember JavaDoc (
73             "s",
74             _tcOf_members0,
75             null);
76           __typeCode = org.omg.CORBA.ORB.init ().create_exception_tc (org.jboss.test.excepiiop.interfaces.IdlExceptionHelper.id (), "IdlException", _members0);
77           __active = false;
78         }
79       }
80     }
81     return __typeCode;
82   }
83
84   public static String JavaDoc id ()
85   {
86     return _id;
87   }
88
89   public static org.jboss.test.excepiiop.interfaces.IdlException read (org.omg.CORBA.portable.InputStream JavaDoc istream)
90   {
91     org.jboss.test.excepiiop.interfaces.IdlException value = new org.jboss.test.excepiiop.interfaces.IdlException ();
92     // read and discard the repository ID
93
istream.read_string ();
94     value.i = istream.read_long ();
95     value.s = istream.read_string ();
96     return value;
97   }
98
99   public static void write (org.omg.CORBA.portable.OutputStream JavaDoc ostream, org.jboss.test.excepiiop.interfaces.IdlException value)
100   {
101     // write the repository ID
102
ostream.write_string (id ());
103     ostream.write_long (value.i);
104     ostream.write_string (value.s);
105   }
106
107 }
108
Popular Tags