001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.test.excepiiop.interfaces;
023:
024: /**
025: * org/jboss/test/excepiiop/interfaces/IdlExceptionHelper.java .
026: * Generated by the IDL-to-Java compiler (portable), version "3.1"
027: * from IdlException.idl
028: * Thursday, July 17, 2003 6:39:23 PM BRT
029: */
030:
031: abstract public class IdlExceptionHelper {
032: private static String _id = "IDL:org/jboss/test/excepiiop/interfaces/IdlException:1.0";
033:
034: public static void insert(org.omg.CORBA.Any a,
035: org.jboss.test.excepiiop.interfaces.IdlException that) {
036: org.omg.CORBA.portable.OutputStream out = a
037: .create_output_stream();
038: a.type(type());
039: write(out, that);
040: a.read_value(out.create_input_stream(), type());
041: }
042:
043: public static org.jboss.test.excepiiop.interfaces.IdlException extract(
044: org.omg.CORBA.Any a) {
045: return read(a.create_input_stream());
046: }
047:
048: private static org.omg.CORBA.TypeCode __typeCode = null;
049: private static boolean __active = false;
050:
051: synchronized public static org.omg.CORBA.TypeCode type() {
052: if (__typeCode == null) {
053: synchronized (org.omg.CORBA.TypeCode.class) {
054: if (__typeCode == null) {
055: if (__active) {
056: return org.omg.CORBA.ORB.init()
057: .create_recursive_tc(_id);
058: }
059: __active = true;
060: org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember[2];
061: org.omg.CORBA.TypeCode _tcOf_members0 = null;
062: _tcOf_members0 = org.omg.CORBA.ORB.init()
063: .get_primitive_tc(
064: org.omg.CORBA.TCKind.tk_long);
065: _members0[0] = new org.omg.CORBA.StructMember("i",
066: _tcOf_members0, null);
067: _tcOf_members0 = org.omg.CORBA.ORB.init()
068: .create_string_tc(0);
069: _members0[1] = new org.omg.CORBA.StructMember("s",
070: _tcOf_members0, null);
071: __typeCode = org.omg.CORBA.ORB
072: .init()
073: .create_exception_tc(
074: org.jboss.test.excepiiop.interfaces.IdlExceptionHelper
075: .id(), "IdlException",
076: _members0);
077: __active = false;
078: }
079: }
080: }
081: return __typeCode;
082: }
083:
084: public static String id() {
085: return _id;
086: }
087:
088: public static org.jboss.test.excepiiop.interfaces.IdlException read(
089: org.omg.CORBA.portable.InputStream istream) {
090: org.jboss.test.excepiiop.interfaces.IdlException value = new org.jboss.test.excepiiop.interfaces.IdlException();
091: // read and discard the repository ID
092: istream.read_string();
093: value.i = istream.read_long();
094: value.s = istream.read_string();
095: return value;
096: }
097:
098: public static void write(
099: org.omg.CORBA.portable.OutputStream ostream,
100: org.jboss.test.excepiiop.interfaces.IdlException value) {
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: }
|