Examples of CDROutputStream


Examples of org.jacorb.orb.CDROutputStream

        return (PolicyValue[])l.toArray (new PolicyValue[0]);
    }

    private ServiceContext createInvocationPolicies()
    {
        CDROutputStream out = new CDROutputStream();
        out.beginEncapsulatedArray();
        PolicyValueSeqHelper.write(out, getTimingPolicyValues());
        return new ServiceContext (INVOCATION_POLICIES.value,
                                   out.getBufferCopy());
    }
View Full Code Here

Examples of org.jacorb.orb.CDROutputStream

        {
            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

Examples of org.jacorb.orb.CDROutputStream

     * Creates a ServiceContext for transmitting an exception detail message,
     * as per section 1.15.2 of the Java Mapping.
     */
    private ServiceContext createExceptionDetailMessage (String message)
    {
        CDROutputStream out = new CDROutputStream();
        out.beginEncapsulatedArray();
        out.write_wstring(message);
        return new ServiceContext (org.omg.IOP.ExceptionDetailMessage.value,
                                   out.getBufferCopy());
    }
View Full Code Here

Examples of org.jacorb.orb.CDROutputStream

        checkDestroyed ();
        org.jacorb.orb.Any out_any =
            (org.jacorb.orb.Any)orb.create_any();
        out_any.type( type());

        CDROutputStream out = new CDROutputStream();

        if( type().kind().value() == org.omg.CORBA.TCKind._tk_except )
        {
            out.write_string( exceptionMsg );
        }

        for( int i = 0; i < members.length; i++)
        {
            out.write_value( members[i].value.type(),
                             members[i].value.create_input_stream());
        }

        CDRInputStream is = new CDRInputStream(orb, out.getBufferCopy());
        out_any.read_value( is, type());
        return out_any;
    }
View Full Code Here

Examples of org.jacorb.orb.CDROutputStream

    }

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

        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();
        out.close();

        return result;
    }
View Full Code Here

Examples of org.jacorb.orb.CDROutputStream

    public byte[] encode_value(Any data)
        throws InvalidTypeForEncoding
    {

        CDROutputStream out = new CDROutputStream(orb);

        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();
        out.close();

        return result;
    }
View Full Code Here

Examples of org.jacorb.orb.CDROutputStream

    protected void setUp() throws Exception
    {
        super.setUp();
       
        orb = ORB.init(new String[0], null);
        objectUnderTest = new CDROutputStream(orb);
    }
View Full Code Here

Examples of org.jacorb.orb.CDROutputStream

                CompoundSecMechList compoundSecMechList =
                    new CompoundSecMechList(useStateful, compoundSecMech);

                // export to tagged component
                CDROutputStream sasDataStream = new CDROutputStream( orb );
                sasDataStream.beginEncapsulatedArray();
                CompoundSecMechListHelper.write( sasDataStream , compoundSecMechList );
                tc = new TaggedComponent( TAG_CSI_SEC_MECH_LIST.value,
                                          sasDataStream.getBufferCopy() );

                sasDataStream.close ();
                sasDataStream = null;
            }

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

Examples of org.jacorb.orb.CDROutputStream

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

            //create the tagged component containing the ssl struct
            CDROutputStream out = new CDROutputStream();
            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() )
                 );
        }
    }
View Full Code Here

Examples of org.jacorb.orb.CDROutputStream

            // The CDROutputStream only does big endian currently.
            throw new Error("We can only marshal big endian stylee profiles !!");
        }
       
        // Start a CDR encapsulation for the profile_data
        CDROutputStream profileDataStream = new CDROutputStream();
        profileDataStream.beginEncapsulatedArray();
       
        // Write the opaque AddressProfile bytes for this profile...
        writeAddressProfile(profileDataStream);
       
        // ... then the object key
        profileDataStream.write_long(objectKey.length);
        profileDataStream.write_octet_array(objectKey,0,objectKey.length);
       
        switch( version.minor )
        {
            case 0 :
                // For GIOP 1.0 there were no tagged components
                break;
            default :
                // Assume minor != 0 means 1.1 onwards and encode the TaggedComponents
                if (components == null)
                {
                    components = new TaggedComponentSeqHolder (new TaggedComponent[0]);
                }
                // Write the length of the TaggedProfile sequence.
                profileDataStream.write_long(this.components.size() + components.value.length);
               
                // Write the TaggedProfiles (ours first, then the ORB's)
                for (int i = 0; i < this.components.asArray().length; i++)
                {
                    TaggedComponentHelper.write(profileDataStream, this.components.asArray()[i]);
                }
                for (int i = 0; i < components.value.length; i++)
                {
                    TaggedComponentHelper.write(profileDataStream, components.value[i]);
                }       
        }
       
        // Populate the TaggedProfile for return.
        tagged_profile.value = new TaggedProfile
        (
            this.tag(),
            profileDataStream.getBufferCopy()
        );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.