Java Code Examples for gnu.CORBA.CDR.HeadlessInput

The following are top voted examples for showing how to use gnu.CORBA.CDR.HeadlessInput. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: javify   File: RmiUtilities.java   Source Code and License 4 votes vote down vote up
/**
 * Read fields of the object.
 */
void readFields(int offset, String repositoryID, Serializable object,
  org.omg.CORBA_2_3.portable.InputStream input, gnuRuntime r)
  throws MARSHAL
{
  Field f = null;
  Class o_class = object.getClass();

  try
    {
      // The returned field array must already be in canonical order.
      Field[] fields = getWritableFields(o_class);

      Class fc;

      for (int i = 0; i < fields.length; i++)
        {
          // Full value type header expected ahead.
          if (input instanceof HeadlessInput)
            ((HeadlessInput) input).subsequentCalls = true;

          f = fields[i];
          fc = f.getType();

          Object v;

          if (fc == String.class)
            {
              v = input.read_value(wStringValueHelper);
            }
          else if (fc == int.class)
            v = new Integer(input.read_long());
          else if (fc == long.class)
            v = new Long(input.read_longlong());
          else if (fc == double.class)
            v = new Double(input.read_double());
          else if (fc == float.class)
            v = new Float(input.read_float());
          else if (fc == boolean.class)
            v = input.read_boolean() ? Boolean.TRUE : Boolean.FALSE;
          else if (fc == short.class)
            v = new Short(input.read_short());
          else if (fc == byte.class)
            v = new Byte(input.read_octet());
          else if (fc == char.class)
            v = new Character(input.read_char());
          else if (org.omg.CORBA.Object.class.isAssignableFrom(fc)
            || Remote.class.isAssignableFrom(fc))
            {
              v = readValue(input, offset, fc, null, r);
            }
          else
            {
              v = Vio.read(input, fc);
            }

          f.set(object, v);
        }
    }
  catch (Exception ex)
    {
      MARSHAL m = new MARSHAL("Cannot read " + o_class.getName() + " field "
        + f);
      m.initCause(ex);
      m.minor = Minor.ValueFields;
      throw m;
    }
}
 
Example 2
Project: jvm-stm   File: RmiUtilities.java   Source Code and License 4 votes vote down vote up
/**
 * Read fields of the object.
 */
void readFields(int offset, String repositoryID, Serializable object,
  org.omg.CORBA_2_3.portable.InputStream input, gnuRuntime r)
  throws MARSHAL
{
  Field f = null;
  Class o_class = object.getClass();

  try
    {
      // The returned field array must already be in canonical order.
      Field[] fields = getWritableFields(o_class);

      Class fc;

      for (int i = 0; i < fields.length; i++)
        {
          // Full value type header expected ahead.
          if (input instanceof HeadlessInput)
            ((HeadlessInput) input).subsequentCalls = true;

          f = fields[i];
          fc = f.getType();

          Object v;

          if (fc == String.class)
            {
              v = input.read_value(wStringValueHelper);
            }
          else if (fc == int.class)
            v = new Integer(input.read_long());
          else if (fc == long.class)
            v = new Long(input.read_longlong());
          else if (fc == double.class)
            v = new Double(input.read_double());
          else if (fc == float.class)
            v = new Float(input.read_float());
          else if (fc == boolean.class)
            v = input.read_boolean() ? Boolean.TRUE : Boolean.FALSE;
          else if (fc == short.class)
            v = new Short(input.read_short());
          else if (fc == byte.class)
            v = new Byte(input.read_octet());
          else if (fc == char.class)
            v = new Character(input.read_char());
          else if (org.omg.CORBA.Object.class.isAssignableFrom(fc)
            || Remote.class.isAssignableFrom(fc))
            {
              v = readValue(input, offset, fc, null, r);
            }
          else
            {
              v = Vio.read(input, fc);
            }

          f.set(object, v);
        }
    }
  catch (Exception ex)
    {
      MARSHAL m = new MARSHAL("Cannot read " + o_class.getName() + " field "
        + f);
      m.initCause(ex);
      m.minor = Minor.ValueFields;
      throw m;
    }
}
 
Example 3
Project: JamVM-PH   File: RmiUtilities.java   Source Code and License 4 votes vote down vote up
/**
 * Read fields of the object.
 */
void readFields(int offset, String repositoryID, Serializable object,
  org.omg.CORBA_2_3.portable.InputStream input, gnuRuntime r)
  throws MARSHAL
{
  Field f = null;
  Class o_class = object.getClass();

  try
    {
      // The returned field array must already be in canonical order.
      Field[] fields = getWritableFields(o_class);

      Class fc;

      for (int i = 0; i < fields.length; i++)
        {
          // Full value type header expected ahead.
          if (input instanceof HeadlessInput)
            ((HeadlessInput) input).subsequentCalls = true;

          f = fields[i];
          fc = f.getType();

          Object v;

          if (fc == String.class)
            {
              v = input.read_value(wStringValueHelper);
            }
          else if (fc == int.class)
            v = new Integer(input.read_long());
          else if (fc == long.class)
            v = new Long(input.read_longlong());
          else if (fc == double.class)
            v = new Double(input.read_double());
          else if (fc == float.class)
            v = new Float(input.read_float());
          else if (fc == boolean.class)
            v = input.read_boolean() ? Boolean.TRUE : Boolean.FALSE;
          else if (fc == short.class)
            v = new Short(input.read_short());
          else if (fc == byte.class)
            v = new Byte(input.read_octet());
          else if (fc == char.class)
            v = new Character(input.read_char());
          else if (org.omg.CORBA.Object.class.isAssignableFrom(fc)
            || Remote.class.isAssignableFrom(fc))
            {
              v = readValue(input, offset, fc, null, r);
            }
          else
            {
              v = Vio.read(input, fc);
            }

          f.set(object, v);
        }
    }
  catch (Exception ex)
    {
      MARSHAL m = new MARSHAL("Cannot read " + o_class.getName() + " field "
        + f);
      m.initCause(ex);
      m.minor = Minor.ValueFields;
      throw m;
    }
}
 
Example 4
Project: classpath   File: RmiUtilities.java   Source Code and License 4 votes vote down vote up
/**
 * Read fields of the object.
 */
void readFields(int offset, String repositoryID, Serializable object,
  org.omg.CORBA_2_3.portable.InputStream input, gnuRuntime r)
  throws MARSHAL
{
  Field f = null;
  Class o_class = object.getClass();

  try
    {
      // The returned field array must already be in canonical order.
      Field[] fields = getWritableFields(o_class);

      Class fc;

      for (int i = 0; i < fields.length; i++)
        {
          // Full value type header expected ahead.
          if (input instanceof HeadlessInput)
            ((HeadlessInput) input).subsequentCalls = true;

          f = fields[i];
          fc = f.getType();

          Object v;

          if (fc == String.class)
            {
              v = input.read_value(wStringValueHelper);
            }
          else if (fc == int.class)
            v = new Integer(input.read_long());
          else if (fc == long.class)
            v = new Long(input.read_longlong());
          else if (fc == double.class)
            v = new Double(input.read_double());
          else if (fc == float.class)
            v = new Float(input.read_float());
          else if (fc == boolean.class)
            v = input.read_boolean() ? Boolean.TRUE : Boolean.FALSE;
          else if (fc == short.class)
            v = new Short(input.read_short());
          else if (fc == byte.class)
            v = new Byte(input.read_octet());
          else if (fc == char.class)
            v = new Character(input.read_char());
          else if (org.omg.CORBA.Object.class.isAssignableFrom(fc)
            || Remote.class.isAssignableFrom(fc))
            {
              v = readValue(input, offset, fc, null, r);
            }
          else
            {
              v = Vio.read(input, fc);
            }

          f.set(object, v);
        }
    }
  catch (Exception ex)
    {
      MARSHAL m = new MARSHAL("Cannot read " + o_class.getName() + " field "
        + f);
      m.initCause(ex);
      m.minor = Minor.ValueFields;
      throw m;
    }
}