/[classpath]/classpath/gnu/CORBA/CDR/Vio.java
ViewVC logotype

Diff of /classpath/gnu/CORBA/CDR/Vio.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2.2.2 by gnu_andrew, Tue Aug 16 16:22:35 2005 UTC revision 1.2.2.3 by gnu_andrew, Sat Sep 10 15:31:35 2005 UTC
# Line 46  import org.omg.CORBA.DataOutputStream; Line 46  import org.omg.CORBA.DataOutputStream;
46  import org.omg.CORBA.MARSHAL;  import org.omg.CORBA.MARSHAL;
47  import org.omg.CORBA.NO_IMPLEMENT;  import org.omg.CORBA.NO_IMPLEMENT;
48  import org.omg.CORBA.StringSeqHelper;  import org.omg.CORBA.StringSeqHelper;
49  import org.omg.CORBA.portable.*;  import org.omg.CORBA.portable.BoxedValueHelper;
50  import org.omg.CORBA.portable.InputStream;  import org.omg.CORBA.portable.InputStream;
51  import org.omg.CORBA.portable.OutputStream;  import org.omg.CORBA.portable.OutputStream;
52  import org.omg.CORBA.portable.Streamable;  import org.omg.CORBA.portable.Streamable;
# Line 317  public abstract class Vio Line 317  public abstract class Vio
317     * @throws MARSHAL if the reading has failed due any reason.     * @throws MARSHAL if the reading has failed due any reason.
318     */     */
319    public static Object read(InputStream input, Object value_instance,    public static Object read(InputStream input, Object value_instance,
320                              Object helper      Object helper
321                             )    )
322    {    {
323      try      try
324        {        {
# Line 399  public abstract class Vio Line 399  public abstract class Vio
399     * @return the value that was read.     * @return the value that was read.
400     */     */
401    private static Object read_instance(InputStream input, Object value,    private static Object read_instance(InputStream input, Object value,
402                                        int value_tag, Object helper      int value_tag, Object helper
403                                       )    )
404    {    {
405      try      try
406        {        {
# Line 507  public abstract class Vio Line 507  public abstract class Vio
507    
508        // Stating the interfaces that the USER should use.        // Stating the interfaces that the USER should use.
509        throw new MARSHAL("The " + value.getClass().getName() +        throw new MARSHAL("The " + value.getClass().getName() +
510                          " must implement either StreamableValue or CustomValue."          " must implement either StreamableValue or CustomValue."
511                         );        );
512    
513      // The negative end of state marker is expected from OMG standard.      // The negative end of state marker is expected from OMG standard.
514      // If the chunking is used, this marker is already extracted.      // If the chunking is used, this marker is already extracted.
# Line 562  public abstract class Vio Line 562  public abstract class Vio
562     * @throws MARSHAL if the writing failed due any reason.     * @throws MARSHAL if the writing failed due any reason.
563     */     */
564    public static void write(OutputStream output, Serializable value,    public static void write(OutputStream output, Serializable value,
565                             Class substitute      Class substitute
566                            )    )
567    {    {
568      // Write null if this is a null value.      // Write null if this is a null value.
569      if (value == null)      if (value == null)
# Line 598  public abstract class Vio Line 598  public abstract class Vio
598     * not null.     * not null.
599     */     */
600    public static void write(OutputStream output, Serializable value,    public static void write(OutputStream output, Serializable value,
601                             Object helper      Object helper
602                            )    )
603    {    {
604      if (value == null)      if (value == null)
605        output.write_long(vt_NULL);        output.write_long(vt_NULL);
# Line 627  public abstract class Vio Line 627  public abstract class Vio
627     * if the value should be written unsing other methods.     * if the value should be written unsing other methods.
628     */     */
629    private static void write_instance(OutputStream output, Serializable value,    private static void write_instance(OutputStream output, Serializable value,
630                                       String id, Object helper      String id, Object helper
631                                      )    )
632    {    {
633      // This implementation always writes a single repository id.      // This implementation always writes a single repository id.
634      // It never writes multiple repository ids and currently does not use      // It never writes multiple repository ids and currently does not use
# Line 684  public abstract class Vio Line 684  public abstract class Vio
684              // for the global boxed value type itself.              // for the global boxed value type itself.
685              Method write =              Method write =
686                helperClass.getMethod("write",                helperClass.getMethod("write",
687                                      new Class[]                  new Class[]
688                                      {                  {
689                                        org.omg.CORBA.portable.OutputStream.class,                    org.omg.CORBA.portable.OutputStream.class, value.getClass()
690                                        value.getClass()                  }
691                                      }                );
                                    );  
692              write.invoke(null, new Object[] { outObj, value });              write.invoke(null, new Object[] { outObj, value });
693              ok = true;              ok = true;
694            }            }
# Line 701  public abstract class Vio Line 700  public abstract class Vio
700          // Stating the interfaces that the USER should use.          // Stating the interfaces that the USER should use.
701          if (!ok)          if (!ok)
702            throw new MARSHAL("The " + value.getClass().getName() +            throw new MARSHAL("The " + value.getClass().getName() +
703                              " must implement either StreamableValue" +              " must implement either StreamableValue" + " or CustomValue."
704                              " or CustomValue."            );
                            );  
705        }        }
706    
707      if (USE_CHUNKING)      if (USE_CHUNKING)
# Line 731  public abstract class Vio Line 729  public abstract class Vio
729     *     *
730     * @throws NO_IMPLEMENT, always.     * @throws NO_IMPLEMENT, always.
731     */     */
732    static void incorrect_plug_in(Throwable ex)    static void incorrect_plug_in(Throwable ex) throws NO_IMPLEMENT
                          throws NO_IMPLEMENT  
733    {    {
734      NO_IMPLEMENT no = new NO_IMPLEMENT("Incorrect CORBA plug-in");      NO_IMPLEMENT no = new NO_IMPLEMENT("Incorrect CORBA plug-in");
735      no.initCause(ex);      no.initCause(ex);
# Line 749  public abstract class Vio Line 746  public abstract class Vio
746    private static final void checkTag(int value_tag)    private static final void checkTag(int value_tag)
747    {    {
748      if ((value_tag < 0x7fffff00 || value_tag > 0x7fffffff) &&      if ((value_tag < 0x7fffff00 || value_tag > 0x7fffffff) &&
749          value_tag != vt_NULL && value_tag != vt_INDIRECTION        value_tag != vt_NULL &&
750         )        value_tag != vt_INDIRECTION
751        )
752        throw new MARSHAL("Invalid value record, unsupported header tag: " +        throw new MARSHAL("Invalid value record, unsupported header tag: " +
753                          value_tag          value_tag
754                         );        );
755    }    }
756  }  }

Legend:
Removed from v.1.2.2.2  
changed lines
  Added in v.1.2.2.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26