Package org.jacorb.orb

Examples of org.jacorb.orb.CDROutputStream$DeferredWriteFrame


        {
            org.omg.CORBA.Any any = orb.create_any();

            // create the output stream for the result

            CDROutputStream _out = ((CDROutputStream)any.create_output_stream());

            // get a copy of the content of this reply
            byte[] result_buf = out.getBody();

            // ... and insert it
            _out.setBuffer( result_buf  );
            // important: set the _out buffer's position to the end of the contents!
            _out.skip( result_buf.length );
            return any;
        }
        return result;
    }
View Full Code Here


     * Creates a ServiceContext for transmitting an exception detail message,
     * as per section 1.15.2 of the Java Mapping.
     */
    public static ServiceContext createExceptionDetailMessage (String message)
    {
        final CDROutputStream out = new CDROutputStream();

        try
        {
            out.beginEncapsulatedArray();
            out.write_wstring(message);
            return new ServiceContext(org.omg.IOP.ExceptionDetailMessage.value,
                    out.getBufferCopy());
        }
        finally
        {
            out.close();
        }
    }
View Full Code Here

            ex.printStackTrace();
            // will have to do with defaults
        }

        // encapsulate it into TaggedComponent
        final CDROutputStream out = new CDROutputStream( orb );
        try
        {
            out.beginEncapsulatedArray();
            org.omg.CONV_FRAME.CodeSetComponentInfoHelper.write( out, CodeSet.getLocalCodeSetComponentInfo() );

            tagc = new org.omg.IOP.TaggedComponent( org.omg.IOP.TAG_CODE_SETS.value,
                    out.getBufferCopy());
        }
        finally
        {
            out.close();
        }
    }
View Full Code Here

    * @return an Any that holds a copy of this union
    */
   public org.omg.CORBA.Any to_any()
   {
       checkDestroyed ();
       final CDROutputStream out = new CDROutputStream(orb);

       try
       {
           out.write_value( discriminator.type(),
                   discriminator.create_input_stream() );

           out.write_value( member.type(),
                   member.to_any().create_input_stream());

           org.omg.CORBA.Any out_any = orb.create_any();

           out_any.type( type() );
           final CDRInputStream in = new CDRInputStream( orb, out.getBufferCopy());

           try
           {
               out_any.read_value( in, type());
               return out_any;
           }
           finally
           {
               in.close();
           }
       }
       finally
       {
           out.close();
       }
   }
View Full Code Here


   public org.omg.CORBA.Any to_any()
   {
       checkDestroyed ();
       final CDROutputStream out = new CDROutputStream(orb);
       try
       {
           out.write_long( enumValue );

           org.omg.CORBA.Any out_any = orb.create_any();
           out_any.type(type());
           final CDRInputStream in = new CDRInputStream(orb, out.getBufferCopy());

           try
           {
               out_any.read_value( in, type());
               return out_any;
           }
           finally
           {
               in.close();
           }
       }
       finally
       {
           out.close();
       }
   }
View Full Code Here

   {
       checkDestroyed ();
       final org.omg.CORBA.Any out_any = orb.create_any();
       out_any.type( type());

       final CDROutputStream out = new CDROutputStream(orb);

       try
       {
           for( int i = 0; i < limit; i++)
           {
               out.write_value( elementType,
                       members[i].create_input_stream());
           }

           final CDRInputStream in = new CDRInputStream(orb, out.getBufferCopy());
           try
           {
               out_any.read_value( in, type());
               return out_any;
           }
           finally
           {
               in.close();
           }
       }
       finally
       {
           out.close();
       }
   }
View Full Code Here

                ssl.target_supports |= 0x80;

                //this is SSLs default behaviour, included for completeness
                ssl.target_supports |= 0x20; //establish trust in target

                CDROutputStream sslDataStream =
                    new CDROutputStream( orb );

                sslDataStream.beginEncapsulatedArray();

                SSLHelper.write( sslDataStream , ssl );

                tc = new TaggedComponent( org.omg.SSLIOP.TAG_SSL_SEC_TRANS.value,
                                          sslDataStream.getBufferCopy() );

                sslDataStream.close ();
                sslDataStream = null;
            }

            info.add_ior_component_to_profile (tc, TAG_INTERNET_IOP.value);
        }
View Full Code Here

    }

    public byte[] encode(Any data)
        throws InvalidTypeForEncoding
    {
        final CDROutputStream out = new CDROutputStream(orb);
        try
        {
            out.setGIOPMinor( giopMinor );

            out.beginEncapsulatedArray();
            out.write_any(data);

            /*
             closing must not be done, since it will patch the
             array with a size!
             try
             {
             out.endEncapsulation();
             }
             catch (java.io.IOException e)
             {
             }
             */

            /*
             * We have to copy anyway since we need an exact-sized array.
             * Closing afterwards, to return buffer to BufferManager.
             */
            byte[] result = out.getBufferCopy();

            return result;
        }
        finally
        {
            out.close();
        }
    }
View Full Code Here

    }

    public byte[] encode_value(Any data)
        throws InvalidTypeForEncoding
    {
        final CDROutputStream out = new CDROutputStream(orb);

        try
        {
            out.setGIOPMinor( giopMinor );

            out.beginEncapsulatedArray();
            data.write_value(out);

            /*
             closing must not be done, since it will patch the
             array with a size!

             try
             {
             out.endEncapsulation();
             }
             catch (java.io.IOException e)
             {
             }
             */

            /*
             * We have to copy anyway since we need an exact-sized array.
             * Closing afterwards, to return buffer to BufferManager.
             */
            byte[] result = out.getBufferCopy();

            return result;
        }
        finally
        {
            out.close();
        }
    }
View Full Code Here

            propname =
                "jacorb.security.ssl.corbaloc_ssliop.required_options";
            ssl.target_requires = get_ssl_options(propname);

            //create the tagged component containing the ssl struct
            final CDROutputStream out = new CDROutputStream();
            try
            {
                out.beginEncapsulatedArray();
                SSLHelper.write( out, ssl );

                // TAG_SSL_SEC_TRANS must be disambiguated in case OpenORB-generated
                // OMG classes are in the classpath.
                components.addComponent
                (new TaggedComponent( org.omg.SSLIOP.TAG_SSL_SEC_TRANS.value,
                        out.getBufferCopy() )
                );
            }
            finally
            {
                out.close();
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.jacorb.orb.CDROutputStream$DeferredWriteFrame

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.