Java Code Examples for org.omg.CORBA.ByteHolder

The following are top voted examples for showing how to use org.omg.CORBA.ByteHolder. 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: DemoServant.java   View source code 6 votes vote down vote up
/**
 * Accept and return parameters, having various types.
 */
public int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
                      StringHolder a_string, DoubleHolder a_double
                     )
{
  System.out.println("SERVER: ***** Test passing multiple parameters");
  System.out.println("SERVER:   Received:");
  System.out.println("SERVER:   octet " + an_octet.value);
  System.out.println("SERVER:   short " + a_short.value);
  System.out.println("SERVER:   string " + a_string.value);

  // Returning incremented values.
  an_octet.value++;
  a_short.value++;

  // OUT parameter, return only.
  a_double.value = 1;
  a_string.value += " [return]";
  return 452572;
}
 
Example 2
Project: javify   File: DirectTest.java   View source code 6 votes vote down vote up
/**
 * Test passing multiple parameters in both directions.
 */
public void testParameters()
{
  System.out.println("***** Pass multiple parameters.");

  // Holder classes are required to simulate passing
  // "by reference" (modification is returned back to the server).
  ByteHolder a_byte = new ByteHolder((byte) 0);
  ShortHolder a_short = new ShortHolder((short) 3);
  StringHolder a_string = new StringHolder("[string 4]");

  // This is an 'out' parameter; the value must not be passed to servant.
  DoubleHolder a_double = new DoubleHolder(56.789);

  int returned = object.passSimple(a_byte, 2, a_short, a_string, a_double);

  System.out.println("  Returned value " + returned);
  System.out.println("  Returned parameters: ");
  System.out.println("  octet " + a_byte.value);
  System.out.println("  short " + a_short.value);
  System.out.println("  string '" + a_string.value+"'");
  System.out.println("  double " + a_double.value);
}
 
Example 3
Project: jvm-stm   File: DemoServant.java   View source code 6 votes vote down vote up
/**
 * Accept and return parameters, having various types.
 */
public int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
                      StringHolder a_string, DoubleHolder a_double
                     )
{
  System.out.println("SERVER: ***** Test passing multiple parameters");
  System.out.println("SERVER:   Received:");
  System.out.println("SERVER:   octet " + an_octet.value);
  System.out.println("SERVER:   short " + a_short.value);
  System.out.println("SERVER:   string " + a_string.value);

  // Returning incremented values.
  an_octet.value++;
  a_short.value++;

  // OUT parameter, return only.
  a_double.value = 1;
  a_string.value += " [return]";
  return 452572;
}
 
Example 4
Project: jvm-stm   File: DirectTest.java   View source code 6 votes vote down vote up
/**
 * Test passing multiple parameters in both directions.
 */
public void testParameters()
{
  System.out.println("***** Pass multiple parameters.");

  // Holder classes are required to simulate passing
  // "by reference" (modification is returned back to the server).
  ByteHolder a_byte = new ByteHolder((byte) 0);
  ShortHolder a_short = new ShortHolder((short) 3);
  StringHolder a_string = new StringHolder("[string 4]");

  // This is an 'out' parameter; the value must not be passed to servant.
  DoubleHolder a_double = new DoubleHolder(56.789);

  int returned = object.passSimple(a_byte, 2, a_short, a_string, a_double);

  System.out.println("  Returned value " + returned);
  System.out.println("  Returned parameters: ");
  System.out.println("  octet " + a_byte.value);
  System.out.println("  short " + a_short.value);
  System.out.println("  string '" + a_string.value+"'");
  System.out.println("  double " + a_double.value);
}
 
Example 5
Project: JamVM-PH   File: DemoServant.java   View source code 6 votes vote down vote up
/**
 * Accept and return parameters, having various types.
 */
public int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
                      StringHolder a_string, DoubleHolder a_double
                     )
{
  System.out.println("SERVER: ***** Test passing multiple parameters");
  System.out.println("SERVER:   Received:");
  System.out.println("SERVER:   octet " + an_octet.value);
  System.out.println("SERVER:   short " + a_short.value);
  System.out.println("SERVER:   string " + a_string.value);

  // Returning incremented values.
  an_octet.value++;
  a_short.value++;

  // OUT parameter, return only.
  a_double.value = 1;
  a_string.value += " [return]";
  return 452572;
}
 
Example 6
Project: JamVM-PH   File: DirectTest.java   View source code 6 votes vote down vote up
/**
 * Test passing multiple parameters in both directions.
 */
public void testParameters()
{
  System.out.println("***** Pass multiple parameters.");

  // Holder classes are required to simulate passing
  // "by reference" (modification is returned back to the server).
  ByteHolder a_byte = new ByteHolder((byte) 0);
  ShortHolder a_short = new ShortHolder((short) 3);
  StringHolder a_string = new StringHolder("[string 4]");

  // This is an 'out' parameter; the value must not be passed to servant.
  DoubleHolder a_double = new DoubleHolder(56.789);

  int returned = object.passSimple(a_byte, 2, a_short, a_string, a_double);

  System.out.println("  Returned value " + returned);
  System.out.println("  Returned parameters: ");
  System.out.println("  octet " + a_byte.value);
  System.out.println("  short " + a_short.value);
  System.out.println("  string '" + a_string.value+"'");
  System.out.println("  double " + a_double.value);
}
 
Example 7
Project: classpath   File: DemoServant.java   View source code 6 votes vote down vote up
/**
 * Accept and return parameters, having various types.
 */
public int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
                      StringHolder a_string, DoubleHolder a_double
                     )
{
  System.out.println("SERVER: ***** Test passing multiple parameters");
  System.out.println("SERVER:   Received:");
  System.out.println("SERVER:   octet " + an_octet.value);
  System.out.println("SERVER:   short " + a_short.value);
  System.out.println("SERVER:   string " + a_string.value);

  // Returning incremented values.
  an_octet.value++;
  a_short.value++;

  // OUT parameter, return only.
  a_double.value = 1;
  a_string.value += " [return]";
  return 452572;
}
 
Example 8
Project: classpath   File: DirectTest.java   View source code 6 votes vote down vote up
/**
 * Test passing multiple parameters in both directions.
 */
public void testParameters()
{
  System.out.println("***** Pass multiple parameters.");

  // Holder classes are required to simulate passing
  // "by reference" (modification is returned back to the server).
  ByteHolder a_byte = new ByteHolder((byte) 0);
  ShortHolder a_short = new ShortHolder((short) 3);
  StringHolder a_string = new StringHolder("[string 4]");

  // This is an 'out' parameter; the value must not be passed to servant.
  DoubleHolder a_double = new DoubleHolder(56.789);

  int returned = object.passSimple(a_byte, 2, a_short, a_string, a_double);

  System.out.println("  Returned value " + returned);
  System.out.println("  Returned parameters: ");
  System.out.println("  octet " + a_byte.value);
  System.out.println("  short " + a_short.value);
  System.out.println("  string '" + a_string.value+"'");
  System.out.println("  double " + a_double.value);
}
 
Example 9
Project: javify   File: _DemoTesterStub.java   View source code 4 votes vote down vote up
/**
 * Passes various parameters in both directions. The parameters that
 * shoud also return the values are wrapped into holders.
 */
public int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
                      StringHolder a_string, DoubleHolder a_double
                     )
{
  InputStream in = null;
  try
    {
      // Get the stream where the parameters must be written:
      OutputStream out = _request("passSimple", true);

      // Write the parameters.
      out.write_octet(an_octet.value);
      out.write_long(a_long);
      out.write_short(a_short.value);
      out.write_string(a_string.value);

      // Invoke the method.
      in = _invoke(out);

      // Read the returned values.
      int result = in.read_long();

      // Read the inout and out parameters.
      an_octet.value = in.read_octet();
      a_short.value = in.read_short();
      a_string.value = in.read_string();
      a_double.value = in.read_double();
      return result;
    }
  catch (ApplicationException ex)
    {
      // Handle excepion on remote side.
      in = ex.getInputStream();
      throw new MARSHAL(ex.getId());
    }
  catch (RemarshalException _rm)
    {
      // Handle instruction to resend the parameters.
      return passSimple(an_octet, a_long, a_short, a_string, a_double);
    }
  finally
    {
      _releaseReply(in);
    }
}
 
Example 10
Project: jvm-stm   File: _DemoTesterStub.java   View source code 4 votes vote down vote up
/**
 * Passes various parameters in both directions. The parameters that
 * shoud also return the values are wrapped into holders.
 */
public int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
                      StringHolder a_string, DoubleHolder a_double
                     )
{
  InputStream in = null;
  try
    {
      // Get the stream where the parameters must be written:
      OutputStream out = _request("passSimple", true);

      // Write the parameters.
      out.write_octet(an_octet.value);
      out.write_long(a_long);
      out.write_short(a_short.value);
      out.write_string(a_string.value);

      // Invoke the method.
      in = _invoke(out);

      // Read the returned values.
      int result = in.read_long();

      // Read the inout and out parameters.
      an_octet.value = in.read_octet();
      a_short.value = in.read_short();
      a_string.value = in.read_string();
      a_double.value = in.read_double();
      return result;
    }
  catch (ApplicationException ex)
    {
      // Handle excepion on remote side.
      in = ex.getInputStream();
      throw new MARSHAL(ex.getId());
    }
  catch (RemarshalException _rm)
    {
      // Handle instruction to resend the parameters.
      return passSimple(an_octet, a_long, a_short, a_string, a_double);
    }
  finally
    {
      _releaseReply(in);
    }
}
 
Example 11
Project: JamVM-PH   File: _DemoTesterStub.java   View source code 4 votes vote down vote up
/**
 * Passes various parameters in both directions. The parameters that
 * shoud also return the values are wrapped into holders.
 */
public int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
                      StringHolder a_string, DoubleHolder a_double
                     )
{
  InputStream in = null;
  try
    {
      // Get the stream where the parameters must be written:
      OutputStream out = _request("passSimple", true);

      // Write the parameters.
      out.write_octet(an_octet.value);
      out.write_long(a_long);
      out.write_short(a_short.value);
      out.write_string(a_string.value);

      // Invoke the method.
      in = _invoke(out);

      // Read the returned values.
      int result = in.read_long();

      // Read the inout and out parameters.
      an_octet.value = in.read_octet();
      a_short.value = in.read_short();
      a_string.value = in.read_string();
      a_double.value = in.read_double();
      return result;
    }
  catch (ApplicationException ex)
    {
      // Handle excepion on remote side.
      in = ex.getInputStream();
      throw new MARSHAL(ex.getId());
    }
  catch (RemarshalException _rm)
    {
      // Handle instruction to resend the parameters.
      return passSimple(an_octet, a_long, a_short, a_string, a_double);
    }
  finally
    {
      _releaseReply(in);
    }
}
 
Example 12
Project: classpath   File: _DemoTesterStub.java   View source code 4 votes vote down vote up
/**
 * Passes various parameters in both directions. The parameters that
 * shoud also return the values are wrapped into holders.
 */
public int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
                      StringHolder a_string, DoubleHolder a_double
                     )
{
  InputStream in = null;
  try
    {
      // Get the stream where the parameters must be written:
      OutputStream out = _request("passSimple", true);

      // Write the parameters.
      out.write_octet(an_octet.value);
      out.write_long(a_long);
      out.write_short(a_short.value);
      out.write_string(a_string.value);

      // Invoke the method.
      in = _invoke(out);

      // Read the returned values.
      int result = in.read_long();

      // Read the inout and out parameters.
      an_octet.value = in.read_octet();
      a_short.value = in.read_short();
      a_string.value = in.read_string();
      a_double.value = in.read_double();
      return result;
    }
  catch (ApplicationException ex)
    {
      // Handle excepion on remote side.
      in = ex.getInputStream();
      throw new MARSHAL(ex.getId());
    }
  catch (RemarshalException _rm)
    {
      // Handle instruction to resend the parameters.
      return passSimple(an_octet, a_long, a_short, a_string, a_double);
    }
  finally
    {
      _releaseReply(in);
    }
}
 
Example 13
Project: javify   File: DemoTester.java   View source code 2 votes vote down vote up
/**
 * Passes various parameters in both directions.
 * The parameters that must return the value are wrapped in holders.
 */
int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
               StringHolder a_string, DoubleHolder a_double
              );
 
Example 14
Project: jvm-stm   File: DemoTester.java   View source code 2 votes vote down vote up
/**
 * Passes various parameters in both directions.
 * The parameters that must return the value are wrapped in holders.
 */
int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
               StringHolder a_string, DoubleHolder a_double
              );
 
Example 15
Project: JamVM-PH   File: DemoTester.java   View source code 2 votes vote down vote up
/**
 * Passes various parameters in both directions.
 * The parameters that must return the value are wrapped in holders.
 */
int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
               StringHolder a_string, DoubleHolder a_double
              );
 
Example 16
Project: classpath   File: DemoTester.java   View source code 2 votes vote down vote up
/**
 * Passes various parameters in both directions.
 * The parameters that must return the value are wrapped in holders.
 */
int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
               StringHolder a_string, DoubleHolder a_double
              );