001    package org.omg.CosTransactions;
002    
003    
004    /**
005     * Generated from IDL struct "PropagationContext".
006     *
007     * @author JacORB IDL compiler V 2.3.0 (JBoss patch 6), 06-Jun-2007
008     * @version generated at Jun 18, 2012 10:37:00 AM
009     */
010    
011    public final class PropagationContextHelper
012    {
013            private static org.omg.CORBA.TypeCode _type = null;
014            public static org.omg.CORBA.TypeCode type ()
015            {
016                    if (_type == null)
017                    {
018                            _type = org.omg.CORBA.ORB.init().create_struct_tc(org.omg.CosTransactions.PropagationContextHelper.id(),"PropagationContext",new org.omg.CORBA.StructMember[]{new org.omg.CORBA.StructMember("timeout", org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.from_int(5)), null),new org.omg.CORBA.StructMember("current", org.omg.CosTransactions.TransIdentityHelper.type(), null),new org.omg.CORBA.StructMember("parents", org.omg.CORBA.ORB.init().create_sequence_tc(0, org.omg.CosTransactions.TransIdentityHelper.type()), null),new org.omg.CORBA.StructMember("implementation_specific_data", org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.from_int(11)), null)});
019                    }
020                    return _type;
021            }
022    
023            public static void insert (final org.omg.CORBA.Any any, final org.omg.CosTransactions.PropagationContext s)
024            {
025                    any.type(type());
026                    write( any.create_output_stream(),s);
027            }
028    
029            public static org.omg.CosTransactions.PropagationContext extract (final org.omg.CORBA.Any any)
030            {
031                    return read(any.create_input_stream());
032            }
033    
034            public static String id()
035            {
036                    return "IDL:CosTransactions/PropagationContext:1.0";
037            }
038            public static org.omg.CosTransactions.PropagationContext read (final org.omg.CORBA.portable.InputStream in)
039            {
040                    org.omg.CosTransactions.PropagationContext result = new org.omg.CosTransactions.PropagationContext();
041                    result.timeout=in.read_ulong();
042                    result.current=org.omg.CosTransactions.TransIdentityHelper.read(in);
043                    int _lresult_parents1 = in.read_long();
044                    try
045                    {
046                             int x = in.available();
047                             if ( x > 0 && _lresult_parents1 > x )
048                                    {
049                                            throw new org.omg.CORBA.MARSHAL("Sequence length too large. Only " + x + " available and trying to assign " + _lresult_parents1);
050                                    }
051                    }
052                    catch (java.io.IOException e)
053                    {
054                    }
055                    result.parents = new org.omg.CosTransactions.TransIdentity[_lresult_parents1];
056                    for (int i=0;i<result.parents.length;i++)
057                    {
058                            result.parents[i]=org.omg.CosTransactions.TransIdentityHelper.read(in);
059                    }
060    
061                    result.implementation_specific_data=in.read_any();
062                    return result;
063            }
064            public static void write (final org.omg.CORBA.portable.OutputStream out, final org.omg.CosTransactions.PropagationContext s)
065            {
066                    out.write_ulong(s.timeout);
067                    org.omg.CosTransactions.TransIdentityHelper.write(out,s.current);
068                    
069                    out.write_long(s.parents.length);
070                    for (int i=0; i<s.parents.length;i++)
071                    {
072                            org.omg.CosTransactions.TransIdentityHelper.write(out,s.parents[i]);
073                    }
074    
075                    out.write_any(s.implementation_specific_data);
076            }
077    }