01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * 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.iiop.interfaces;
23:
24: /**
25: * org/jboss/test/iiop/interfaces/IdlInterfaceHelper.java .
26: * Generated by the IDL-to-Java compiler (portable), version "3.1"
27: * from IdlInterface.idl
28: * Tuesday, October 21, 2003 3:27:10 PM BRST
29: */
30:
31: abstract public class IdlInterfaceHelper {
32: private static String _id = "IDL:org/jboss/test/iiop/interfaces/IdlInterface:1.0";
33:
34: public static void insert(org.omg.CORBA.Any a,
35: org.jboss.test.iiop.interfaces.IdlInterface that) {
36: org.omg.CORBA.portable.OutputStream out = a
37: .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 org.jboss.test.iiop.interfaces.IdlInterface extract(
44: org.omg.CORBA.Any a) {
45: return read(a.create_input_stream());
46: }
47:
48: private static org.omg.CORBA.TypeCode __typeCode = null;
49:
50: synchronized public static org.omg.CORBA.TypeCode type() {
51: if (__typeCode == null) {
52: __typeCode = org.omg.CORBA.ORB.init().create_interface_tc(
53: org.jboss.test.iiop.interfaces.IdlInterfaceHelper
54: .id(), "IdlInterface");
55: }
56: return __typeCode;
57: }
58:
59: public static String id() {
60: return _id;
61: }
62:
63: public static org.jboss.test.iiop.interfaces.IdlInterface read(
64: org.omg.CORBA.portable.InputStream istream) {
65: return narrow(istream.read_Object(_IdlInterfaceStub.class));
66: }
67:
68: public static void write(
69: org.omg.CORBA.portable.OutputStream ostream,
70: org.jboss.test.iiop.interfaces.IdlInterface value) {
71: ostream.write_Object((org.omg.CORBA.Object) value);
72: }
73:
74: public static org.jboss.test.iiop.interfaces.IdlInterface narrow(
75: org.omg.CORBA.Object obj) {
76: if (obj == null)
77: return null;
78: else if (obj instanceof org.jboss.test.iiop.interfaces.IdlInterface)
79: return (org.jboss.test.iiop.interfaces.IdlInterface) obj;
80: else if (!obj._is_a(id()))
81: throw new org.omg.CORBA.BAD_PARAM();
82: else {
83: org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)
84: ._get_delegate();
85: org.jboss.test.iiop.interfaces._IdlInterfaceStub stub = new org.jboss.test.iiop.interfaces._IdlInterfaceStub();
86: stub._set_delegate(delegate);
87: return stub;
88: }
89: }
90:
91: }
|