Examples of CDROutputStream


Examples of com.sun.corba.ee.impl.encoding.CDROutputStream

    }

    private org.omg.IOP.TaggedComponent createCompoundSecMechListComponent(
  CompoundSecMech[] mechList) {

   CDROutputStream out = (CDROutputStream) orb.create_output_stream();
  out.putEndian();

  boolean stateful = false;
  CompoundSecMechList list = new CompoundSecMechList(
      stateful, mechList);
  CompoundSecMechListHelper.write(out, list);
  byte[] buf = out.toByteArray();
  org.omg.IOP.TaggedComponent tc = new org.omg.IOP.TaggedComponent(
      TAG_CSI_SEC_MECH_LIST.value, buf ) ;
  return tc;
    }
View Full Code Here

Examples of com.sun.corba.ee.impl.encoding.CDROutputStream

  int targetSupports, int targetRequires, TransportAddress[] listTa ) {

  TLS_SEC_TRANS tls_sec = new TLS_SEC_TRANS(
      (short)targetSupports, (short)targetRequires, listTa);

   CDROutputStream out = (CDROutputStream) orb.create_output_stream();
   out.putEndian() ;
   TLS_SEC_TRANSHelper.write((org.omg.CORBA.portable.OutputStream)out, tls_sec);

  byte[] buf = out.toByteArray() ;
 
  // create new Tagged Component for SSL
  org.omg.IOP.TaggedComponent tc = new org.omg.IOP.TaggedComponent(
      TAG_TLS_SEC_TRANS.value, buf ) ;
  return tc;
View Full Code Here

Examples of org.apache.geronimo.interop.rmi.iiop.CdrOutputStream

            clientInfo += " (" + clientHostAddress + ")";
        }

        boolean firstMessage = true;
        CdrInputStream input = CdrInputStream.getInstance();
        CdrOutputStream output = CdrOutputStream.getInstance();
        CdrOutputStream results = CdrOutputStream.getInstance();

        for (; ;) {
            boolean sendResponse = true;
            GiopMessage inputMessage;

            try {
                inputMessage = input.receive_message( in, clientInfo );
                firstMessage = false;
            } catch (BadMagicException ex) {
                if (firstMessage) {
                    warnBadMagic(clientInfo, ex);
                } else {
                    warnBadMagicBadSize(clientInfo, ex);
                }
                closeStreams( in, out );
                return;
            } catch (UnsupportedProtocolVersionException ex) {
                warnGiopVersion( clientInfo, ex);
                closeStreams( in, out );
                return;
            } catch (Exception ex) {
                if (input.getOffset() > 0) {
                    ex.printStackTrace();
                    warnReceiveFailed( clientInfo, ex);
                }
                // Otherwise client shutdown was not in the middle of a
                // request, i.e. probably 'normal' and unworthy of a
                // log message.
                closeStreams( in, out );
                return;
            }

            output.setGiopVersion(input.getGiopVersion());

            switch (inputMessage.type) {
                case MsgType_1_1._Request:
                    processRequest(input, output, results, inputMessage.request, clientInfo);
                    if ((inputMessage.request.response_flags & 1) == 0) {
                        sendResponse = false; // oneway request
                    }
                    break;
                case MsgType_1_1._LocateRequest:
                    processLocateRequest(output, inputMessage.locateRequest);
                    break;
                default:
                    throw new SystemException("TODO: message type = " + inputMessage.type);
            }

            if (sendResponse) {
                try {
                    if(inputMessage.httpTunneling)
                    {
                        output.send_http_response( out, clientInfo );
                    }
                    else
                    {
                        output.send_message( out, clientInfo );
                    }
                } catch (Exception ex) {
                    warnSendFailed(clientInfo, ex);
                    closeStreams( in, out );
                    return;
                }
            }

            input.reset();
            output.reset();
            results.reset();
        }
    }
View Full Code Here

Examples of org.jacorb.orb.CDROutputStream

    * @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

Examples of org.jacorb.orb.CDROutputStream


   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

Examples of org.jacorb.orb.CDROutputStream

   {
       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

Examples of org.jacorb.orb.CDROutputStream

                BiDirIIOPServiceContext b =
                    new BiDirIIOPServiceContext( points );
                org.omg.CORBA.Any any = orb.create_any();
                BiDirIIOPServiceContextHelper.insert( any, b );

                final CDROutputStream cdr_out = new CDROutputStream(orb);

                try
                {
                    cdr_out.beginEncapsulatedArray();
                    BiDirIIOPServiceContextHelper.write( cdr_out, b );

                    bidir_ctx = new ServiceContext( BI_DIR_IIOP.value,
                            cdr_out.getBufferCopy() );
                }
                finally
                {
                    cdr_out.close();
                }
            }

            ri.add_request_service_context( bidir_ctx, true );
View Full Code Here

Examples of org.jacorb.orb.CDROutputStream

        return (PolicyValue[])list.toArray (new PolicyValue[list.size()]);
    }

    private ServiceContext createInvocationPolicies()
    {
        final CDROutputStream out = new CDROutputStream();

        try
        {
            out.beginEncapsulatedArray();
            PolicyValueSeqHelper.write(out, getTimingPolicyValues());
            return new ServiceContext (INVOCATION_POLICIES.value,
                    out.getBufferCopy());
        }
        finally
        {
            out.close();
        }
    }
View Full Code Here

Examples of org.jacorb.orb.CDROutputStream

    }

    public static ServiceContext createCodesetContext( CodeSet tcs, CodeSet tcsw )
    {
        // encapsulate context
        final CDROutputStream os = new CDROutputStream();
        try
        {
            os.beginEncapsulatedArray();
            CodeSetContextHelper.write( os, new CodeSetContext( tcs.getId(), tcsw.getId() ));

            return new ServiceContext( TAG_CODE_SETS.value, os.getBufferCopy() );
        }
        finally
        {
            os.close();
        }
    }
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
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.