Package org.jacorb.orb

Examples of org.jacorb.orb.CDRInputStream


    // implementation of org.omg.IOP.CodecOperations interface

    public Any decode(byte[] data)
        throws FormatMismatch
    {
        final CDRInputStream in = new CDRInputStream(orb, data);

        try
        {
            in.openEncapsulatedArray();
            Any result = in.read_any();

            // not necessary to end encapsulation, since stream is never used again

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



    public Any decode_value(byte[] data, TypeCode tc)
        throws FormatMismatch, TypeMismatch
    {
        final CDRInputStream in = new CDRInputStream(orb, data);

        try
        {
            in.openEncapsulatedArray();
            Any result = orb.create_any();
            result.read_value(in, tc);

            // not necessary to end encapsulation, since stream is never used again

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

    */
   public MIOPProfile (byte[] data)
   {
      this.data = data;

      CDRInputStream in = new CDRInputStream (data);
      in.openEncapsulatedArray ();
      uipmc = UIPMC_ProfileBodyHelper.read (in);
      in.close ();

      version = uipmc.miop_version;
   }
View Full Code Here

                  if (logger.isDebugEnabled ())
                  {
                     logger.debug ("MIOPProfile inspecting tagGroup.");
                  }

                  CDRInputStream in2 = new CDRInputStream (orb, component.component_data);
                  in2.openEncapsulatedArray();
                  tagGroup = TagGroupTaggedComponentHelper.read (in2);
                  in2.close();
                  break;
               }
               case TAG_INTERNET_IOP.value:
               {
                  if (logger.isDebugEnabled ())
View Full Code Here

        }
    }

    private static void printTagRMIComponent(TaggedComponent taggedComponent, PrintWriter out)
    {
        final CDRInputStream in = new CDRInputStream( taggedComponent.component_data );

        try
        {
            in.openEncapsulatedArray();
            byte b= in.read_octet();

            out.println( "\t\tTAG_RMI_CUSTOM_MAX_STREAM_FORMAT: " + Byte.toString(b));
        }
        finally
        {
            in.close();
        }
    }
View Full Code Here

        }
    }

    private static void printOrbTypeComponent (TaggedComponent taggedComponent, PrintWriter out)
    {
        final CDRInputStream is = new CDRInputStream (taggedComponent.component_data );

        try
        {
            is.openEncapsulatedArray ();
            int type = is.read_long ();

            out.print ( "\t\tType: " + type);
            if (type == ORBConstants.JACORB_ORB_ID)
            {
                out.println (" (JacORB)");
            }
            else if (type == ORBConstants.TAO_ORB_ID)
            {
                out.println (" (TAO)");
            }
            else
            {
                out.println (" (Foreign)");
            }
        }
        finally
        {
            is.close();
        }
    }
View Full Code Here

        }
    }

    private static void printAlternateAddress(ORB orb, TaggedComponent taggedComponent, PrintWriter out)
    {
        final CDRInputStream is = new CDRInputStream(taggedComponent.component_data);

        try
        {
            is.openEncapsulatedArray();
            String hostname = is.read_string();
            short port = is.read_ushort();

            IIOPAddress result = new IIOPAddress (hostname, port);
            try
            {
               result.configure(((org.jacorb.orb.ORB)orb).getConfiguration ());
            }
            catch( ConfigurationException ce)
            {
               ((org.jacorb.orb.ORB)orb).getConfiguration ().getLogger ("PrintIOR").warn("ConfigurationException", ce );
            }


            out.println("\t\tAddress: " + result.toString ());
        }
        finally
        {
            is.close();
        }
    }
View Full Code Here

        }
    }

    private static void printTagGroupTaggedComponent(TaggedComponent taggedComponent, PrintWriter out)
    {
        final CDRInputStream is = new CDRInputStream(org.omg.CORBA.ORBSingleton.init(), taggedComponent.component_data);

        is.openEncapsulatedArray();
        TagGroupTaggedComponent tagGroup = TagGroupTaggedComponentHelper.read (is);
        is.close ();

        out.println ("\t\tVersion: " + tagGroup.group_version.major + ":" + tagGroup.group_version.minor);
        out.println ("\t\tDomain: " + tagGroup.group_domain_id);
        out.println ("\t\tObjectGroupID: " + tagGroup.object_group_id);
        out.println ("\t\tObject Version: " + tagGroup.object_group_ref_version);
View Full Code Here



    private static void printPolicyComponent (TaggedComponent taggedComponent, PrintWriter out)
    {
        final CDRInputStream is = new CDRInputStream (taggedComponent.component_data);

        try
        {
            int val;
            int count = 0;

            is.openEncapsulatedArray ();
            int len = is.read_long ();

            while (len-- != 0)
            {
                val = is.read_long ();
                out.print( "\t\t#" + count++ + ": ");
                is.openEncapsulation ();
                switch (val)
                {
                    case PRIORITY_BANDED_CONNECTION_POLICY_TYPE.value:
                    {
                        long i;
                        short low;
                        short high;

                        out.println ("RTCORBA::PRIORITY_BANDED_CONNECTION");
                        val = is.read_long ();
                        for (i = 0; i < val; i++)
                        {
                            low = is.read_short ();
                            high = is.read_short ();
                            out.println ("\t\t\tBand " + i + ": " + low + "-" + high);
                        }
                        break;
                    }
                    case PRIORITY_MODEL_POLICY_TYPE.value:
                    {
                        out.print("RTCORBA::PRIORITY_MODEL");
                        val = is.read_long ();
                        switch (val)
                        {
                            case PriorityModel._CLIENT_PROPAGATED:
                            {
                                out.print (" (CLIENT_PROPAGATED, ");
                                break;
                            }
                            case PriorityModel._SERVER_DECLARED:
                            {
                                out.print (" (SERVER_DECLARED, ");
                                break;
                            }
                            default:
                            {
                                out.print (" (Unknown, ");
                                break;
                            }
                        }
                        short prio = is.read_short ();
                        out.println (prio + ")");
                        break;
                    }
                    default:
                    {
                        out.println ("Unknown (" + val + ")");
                        break;
                    }
                }
                is.closeEncapsulation ();
            }

        }
        finally
        {
            is.close();
        }
    }
View Full Code Here

    }

    @Test
    public void testWithNonPrimitiveTCKind()
    {
        CDRInputStream in = getInputStreamFromWithLong(-1);

        try
        {
            objectUnderTest.readTypeCode(in, recursiveTypeCodeMap, repeatedTypeCodeMap);
            fail();
View Full Code Here

TOP

Related Classes of org.jacorb.orb.CDRInputStream

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.