Package org.omg.CORBA.portable

Examples of org.omg.CORBA.portable.InputStream


        Buffer buf = new Buffer();
        OutputStream oStream = new OutputStream(buf);
        CorbaObjectWriter writer = new CorbaObjectWriter(oStream);
        writer.writeException(obj);

        InputStream iStream = oStream.create_input_stream();
       
        String readId = iStream.read_string();
        assertTrue(readId.equals(reposID));
        short readCode = iStream.read_short();
        assertTrue(readCode == code);
        String readMessage = iStream.read_string();
        assertTrue(readMessage.equals(message));
    }
View Full Code Here


            Method readMethod = helperClass.getMethod( "read", readParams );

            // Invoke the read method, passing in the input stream to
            // retrieve the user exception.  Mark and reset the stream
            // as to not disturb it.
            InputStream ueInputStream = appException.getInputStream();
            ueInputStream.mark( 0 );
            UserException userException = null;
            try {
                java.lang.Object[] readArguments = new java.lang.Object[1];
                readArguments[0] = ueInputStream;
                userException = (UserException)readMethod.invoke(
                    null, readArguments );
            }
            finally {
                try {
                    ueInputStream.reset();
                }
                catch( IOException e ) {
                    throw wrapper.markAndResetFailed( e ) ;
                }
            }
View Full Code Here

            // CDROutputStream and reading it back.
            EncapsOutputStream out =
                sun.corba.OutputStreamFactory.newEncapsOutputStream(myORB);

            context.write( out, GIOPVersion.V1_2 );
            InputStream inputStream = out.create_input_stream();
            result = ServiceContextHelper.read( inputStream );

            cachedServiceContexts.put( integerId, result );
        }
View Full Code Here

    {
        int id = 0 ;
        // Convert IOP.service_context to core.ServiceContext:
        EncapsOutputStream outputStream =
           sun.corba.OutputStreamFactory.newEncapsOutputStream(myORB);
        InputStream inputStream = null;
        UnknownServiceContext coreServiceContext = null;
        ServiceContextHelper.write( outputStream, service_context );
        inputStream = outputStream.create_input_stream();

        // Constructor expects id to already have been read from stream.
        coreServiceContext = new UnknownServiceContext(
            inputStream.read_long(),
            (org.omg.CORBA_2_3.portable.InputStream)inputStream );

        id = coreServiceContext.getId();

        if (serviceContexts.get(id) != null)
View Full Code Here

            case TCKind._tk_except:
            case TCKind._tk_struct:
            case TCKind._tk_union:
            case TCKind._tk_sequence:
            case TCKind._tk_array:
                InputStream copyOfMyStream = this.create_input_stream();
                InputStream copyOfOtherStream = otherAny.create_input_stream();
                return equalMember(realType, copyOfMyStream, copyOfOtherStream);

            // Too complicated to handle value types the way we handle
            // other complex types above. Don't try to decompose it here
            // for faster comparison, just use Object.equals().
View Full Code Here

                    dprint(".sendingReply/Any: " + opAndId(req)
                           + ": handling system exception");
                }

                // Get the exception object from the Any
                InputStream in = excany.create_input_stream();
                SystemException ex = ORBUtility.readSystemException(in);
                // Marshal the exception back
                resp = req.getProtocolHandler()
                    .createSystemExceptionResponse(req, ex, scs);
            } else {
View Full Code Here

        // inevitable call to initiateClientPIRequest in createRequest.
        // Also, save the RequestImpl object for later use.
        _orb.getPIHandler().initiateClientPIRequest( true );
        _orb.getPIHandler().setClientPIInfo( this );

        InputStream $in = null;
        try {
            OutputStream $out = delegate.request(null, _opName, !_isOneWay);
            // Marshal args
            try {
                for (int i=0; i<_arguments.count() ; i++) {
View Full Code Here

            .getClientRequestDispatcher();
    }

    public org.omg.CORBA.Object get_interface_def(org.omg.CORBA.Object obj)
    {
        InputStream is = null;
        // instantiate the stub
        org.omg.CORBA.Object stub = null ;

        try {
            OutputStream os = request(null, "_interface", true);
            is = (InputStream) invoke((org.omg.CORBA.Object)null, os);

            org.omg.CORBA.Object objimpl =
                (org.omg.CORBA.Object) is.read_Object();

            // check if returned object is of correct type
            if ( !objimpl._is_a("IDL:omg.org/CORBA/InterfaceDef:1.0") )
                throw wrapper.wrongInterfaceDef(CompletionStatus.COMPLETED_MAYBE);
View Full Code Here

        }

        // But repositoryIds may not be complete, so it may be necessary to
        // go to server.

        InputStream is = null;
        try {
            OutputStream os = request(null, "_is_a", true);
            os.write_string(dest);
            is = (InputStream) invoke((org.omg.CORBA.Object) null, os);

            return is.read_boolean();

        } catch (ApplicationException e) {
            // This cannot happen.
            throw wrapper.applicationExceptionInSpecialMethod( e ) ;
        } catch (RemarshalException e) {
View Full Code Here

        }
    }

    public boolean non_existent(org.omg.CORBA.Object obj)
    {
        InputStream is = null;
        try {
            OutputStream os = request(null, "_non_existent", true);
            is = (InputStream) invoke((org.omg.CORBA.Object)null, os);

            return is.read_boolean();

        } catch (ApplicationException e) {
            // This cannot happen.
            throw wrapper.applicationExceptionInSpecialMethod( e ) ;
        } catch (RemarshalException e) {
View Full Code Here

TOP

Related Classes of org.omg.CORBA.portable.InputStream

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.