1   package org.activeio.oneport;
2   
3   /*** 
4    * Helper class for : TestIIOPServer
5    *  
6    * @author OpenORB Compiler
7    */ 
8   public class TestIIOPServerHelper
9   {
10      /***
11       * Insert TestIIOPServer into an any
12       * @param a an any
13       * @param t TestIIOPServer value
14       */
15      public static void insert(org.omg.CORBA.Any a, org.activeio.oneport.TestIIOPServer t)
16      {
17          a.insert_Object(t , type());
18      }
19  
20      /***
21       * Extract TestIIOPServer from an any
22       *
23       * @param a an any
24       * @return the extracted TestIIOPServer value
25       */
26      public static org.activeio.oneport.TestIIOPServer extract( org.omg.CORBA.Any a )
27      {
28          if ( !a.type().equivalent( type() ) )
29          {
30              throw new org.omg.CORBA.MARSHAL();
31          }
32          try
33          {
34              return org.activeio.oneport.TestIIOPServerHelper.narrow( a.extract_Object() );
35          }
36          catch ( final org.omg.CORBA.BAD_PARAM e )
37          {
38              throw new org.omg.CORBA.MARSHAL(e.getMessage());
39          }
40      }
41  
42      //
43      // Internal TypeCode value
44      //
45      private static org.omg.CORBA.TypeCode _tc = null;
46  
47      /***
48       * Return the TestIIOPServer TypeCode
49       * @return a TypeCode
50       */
51      public static org.omg.CORBA.TypeCode type()
52      {
53          if (_tc == null) {
54              org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();
55              _tc = orb.create_interface_tc( id(), "TestIIOPServer" );
56          }
57          return _tc;
58      }
59  
60      /***
61       * Return the TestIIOPServer IDL ID
62       * @return an ID
63       */
64      public static String id()
65      {
66          return _id;
67      }
68  
69      private final static String _id = "IDL:org/activeio/oneport/TestIIOPServer:1.0";
70  
71      /***
72       * Read TestIIOPServer from a marshalled stream
73       * @param istream the input stream
74       * @return the readed TestIIOPServer value
75       */
76      public static org.activeio.oneport.TestIIOPServer read(org.omg.CORBA.portable.InputStream istream)
77      {
78          return(org.activeio.oneport.TestIIOPServer)istream.read_Object(org.activeio.oneport._TestIIOPServerStub.class);
79      }
80  
81      /***
82       * Write TestIIOPServer into a marshalled stream
83       * @param ostream the output stream
84       * @param value TestIIOPServer value
85       */
86      public static void write(org.omg.CORBA.portable.OutputStream ostream, org.activeio.oneport.TestIIOPServer value)
87      {
88          ostream.write_Object((org.omg.CORBA.portable.ObjectImpl)value);
89      }
90  
91      /***
92       * Narrow CORBA::Object to TestIIOPServer
93       * @param obj the CORBA Object
94       * @return TestIIOPServer Object
95       */
96      public static TestIIOPServer narrow(org.omg.CORBA.Object obj)
97      {
98          if (obj == null)
99              return null;
100         if (obj instanceof TestIIOPServer)
101             return (TestIIOPServer)obj;
102 
103         if (obj._is_a(id()))
104         {
105             _TestIIOPServerStub stub = new _TestIIOPServerStub();
106             stub._set_delegate(((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate());
107             return stub;
108         }
109 
110         throw new org.omg.CORBA.BAD_PARAM();
111     }
112 
113     /***
114      * Unchecked Narrow CORBA::Object to TestIIOPServer
115      * @param obj the CORBA Object
116      * @return TestIIOPServer Object
117      */
118     public static TestIIOPServer unchecked_narrow(org.omg.CORBA.Object obj)
119     {
120         if (obj == null)
121             return null;
122         if (obj instanceof TestIIOPServer)
123             return (TestIIOPServer)obj;
124 
125         _TestIIOPServerStub stub = new _TestIIOPServerStub();
126         stub._set_delegate(((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate());
127         return stub;
128 
129     }
130 
131 }