Package org.omg.CORBA.portable

Examples of org.omg.CORBA.portable.OutputStream


*/
  public OutputStream _invoke(String a_method, InputStream in,
                              ResponseHandler rh
                             )
  {
    OutputStream out;

    /* Get the field value. */
    if (a_method.equals("_get_theField"))
      {
        int result = (int) 0;
        result = theField();
        out = rh.createReply();
        out.write_long(result);
      }
    else
    /* Set the field value. */
    if (a_method.equals("_set_theField"))
      {
        int newTheField = in.read_long();
        theField(newTheField);
        out = rh.createReply();
      }
    else
    /* Passes various parameters in both directions. */
    if (a_method.equals("passSimple"))
      {
        ByteHolder an_octet = new ByteHolder();
        an_octet.value = in.read_octet();

        int a_long = in.read_long();
        ShortHolder a_short = new ShortHolder();
        a_short.value = in.read_short();

        StringHolder a_string = new StringHolder();
        a_string.value = in.read_string();

        DoubleHolder a_double = new DoubleHolder();
        int result = passSimple(an_octet, a_long, a_short, a_string, a_double);
        out = rh.createReply();
        out.write_long(result);
        out.write_octet(an_octet.value);
        out.write_short(a_short.value);
        out.write_string(a_string.value);
        out.write_double(a_double.value);
      }
    else
    /* Passes the 'wide' (usually Unicode) string and the ordinary string. */
    if (a_method.equals("passCharacters"))
      {
        String wide = in.read_wstring();
        String narrow = in.read_string();
        String result = null;
        result = passCharacters(wide, narrow);
        out = rh.createReply();
        out.write_wstring(result);
      }
    else
    /*
      Throws either 'ourUserException' with the 'ourField' field
      initialised to the passed positive value
View Full Code Here


  public void setControlTarget(String child_poa_name)
  {
    InputStream in = null;
    try
      {
        OutputStream out = _request("setControlTarget", true);
        out.write_string(child_poa_name);
        in = _invoke(out);
        return;
      }
    catch (ApplicationException ex)
      {
View Full Code Here

  public void setPoaMode(int mode)
  {
    InputStream in = null;
    try
      {
        OutputStream out = _request("setPoaMode", true);
        out.write_long(mode);
        in = _invoke(out);
        return;
      }
    catch (ApplicationException ex)
      {
View Full Code Here

  public int getPoaMode()
  {
    InputStream in = null;
    try
      {
        OutputStream out = _request("getPoaMode", true);
        in = _invoke(out);
        return in.read_long();
      }
    catch (ApplicationException ex)
      {
View Full Code Here

    _methods.put("getPoaMode", new Integer(2));
  }

  public OutputStream _invoke(String method, InputStream in, ResponseHandler rh)
  {
    OutputStream out = null;
    Integer __method = (Integer) _methods.get(method);
    if (__method == null)
      throw new BAD_OPERATION(method, 0, CompletionStatus.COMPLETED_MAYBE);

    switch (__method.intValue())
      {
        /**
         * Set the name of POA to that subsequent operations
         * will apply. This POA must be the child of the POA
         * to that this remotePoaControl servant is connected.
         */
        case 0 : // gnu/classpath/examples/CORBA/SimpleCommunication/communication/remotePoaControl/setControlTarget
        {
          String child_poa_name = in.read_string();
          this.setControlTarget(child_poa_name);
          out = rh.createReply();
          break;
        }

        /**
             * Set the mode of the POA being controlled (active,
             * holding, discarding, deactivated).
             */
        case 1 : // gnu/classpath/examples/CORBA/SimpleCommunication/communication/remotePoaControl/setPoaMode
        {
          int mode = in.read_long();
          this.setPoaMode(mode);
          out = rh.createReply();
          break;
        }

        /**
             * Get the mode of POA being controlled.
             */
        case 2 : // gnu/classpath/examples/CORBA/SimpleCommunication/communication/remotePoaControl/getPoaMode
        {
          int result = getPoaMode();
          out = rh.createReply();
          out.write_long(result);
          break;
        }

        default :
          throw new BAD_OPERATION(0, CompletionStatus.COMPLETED_MAYBE);
View Full Code Here

{
  private static String _id = "IDL:test/poa/TestLocationForwardServer:1.0";

  public static void insert(Any a, TestLocationForwardServer that)
  {
    OutputStream out = a.create_output_stream();
    a.type(type());
    write(out, that);
    a.read_value(out.create_input_stream(), type());
  }
View Full Code Here

        try
          {
            org.omg.CORBA_2_3.portable.InputStream in = null;
            try
              {
                OutputStream out = _request("sayHello", true);
                Util.writeRemoteObject(out, arg0);
                in = (org.omg.CORBA_2_3.portable.InputStream) _invoke(out);
                return (String) in.read_value(String.class);
              }
            catch (ApplicationException ex)
View Full Code Here

        try
          {
            org.omg.CORBA.portable.InputStream in = null;
            try
              {
                OutputStream out = _request("multiply", true);
                out.write_octet(arg0);
                out.write_longlong(arg1);
                in = _invoke(out);
                return in.read_longlong();
              }
            catch (ApplicationException ex)
              {
View Full Code Here

        try
          {
            org.omg.CORBA_2_3.portable.InputStream in = null;
            try
              {
                OutputStream out = _request("passCorbaObject", true);
                out.write_Object(arg0);
                in = (org.omg.CORBA_2_3.portable.InputStream) _invoke(out);
                return (String) in.read_value(String.class);
              }
            catch (ApplicationException ex)
              {
View Full Code Here

        try
          {
            org.omg.CORBA.portable.InputStream in = null;
            try
              {
                OutputStream out = _request("passReturnRemote", true);
                Util.writeRemoteObject(out, arg0);
                in = _invoke(out);
                return (RMI_test) PortableRemoteObject.narrow(in.read_Object(),
                  RMI_test.class);
              }
View Full Code Here

TOP

Related Classes of org.omg.CORBA.portable.OutputStream

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.