package Client;


/**
* Client/ControlPOA.java .
* Generated by the IDL-to-Java compiler (portable), version "3.1"
* from ../client.idl
* Donnerstag, 13. Juni 2002 14.16 Uhr CEST
*/

public abstract class ControlPOA extends org.omg.PortableServer.Servant
 implements Client.ControlOperations, org.omg.CORBA.portable.InvokeHandler
{

  // Constructors

  private static java.util.Hashtable _methods = new java.util.Hashtable ();
  static
  {
    _methods.put ("setId", new java.lang.Integer (0));
    _methods.put ("getId", new java.lang.Integer (1));
    _methods.put ("start", new java.lang.Integer (2));
    _methods.put ("stop", new java.lang.Integer (3));
    _methods.put ("sendBigArrayToClient", new java.lang.Integer (4));
    _methods.put ("sendWStringToClient", new java.lang.Integer (5));
  }

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

    switch (__method.intValue ())
    {
       case 0:  // Client/Control/setId
       {
         int id = in.read_long ();
         this.setId (id);
         out = $rh.createReply();
         break;
       }

       case 1:  // Client/Control/getId
       {
         int $result = (int)0;
         $result = this.getId ();
         out = $rh.createReply();
         out.write_long ($result);
         break;
       }

       case 2:  // Client/Control/start
       {
         this.start ();
         out = $rh.createReply();
         break;
       }

       case 3:  // Client/Control/stop
       {
         String $result = null;
         $result = this.stop ();
         out = $rh.createReply();
         out.write_string ($result);
         break;
       }

       case 4:  // Client/Control/sendBigArrayToClient
       {
         byte buffer[] = Client.ControlPackage.octs4096Helper.read (in);
         this.sendBigArrayToClient (buffer);
         out = $rh.createReply();
         break;
       }

       case 5:  // Client/Control/sendWStringToClient
       {
         String wstr = in.read_wstring ();
         this.sendWStringToClient (wstr);
         out = $rh.createReply();
         break;
       }

       default:
         throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    }

    return out;
  } // _invoke

  // Type-specific CORBA::Object operations
  private static String[] __ids = {
    "IDL:Client/Control:1.0"};

  public String[] _all_interfaces (org.omg.PortableServer.POA poa, byte[] objectId)
  {
    return (String[])__ids.clone ();
  }

  public Control _this() 
  {
    return ControlHelper.narrow(
    super._this_object());
  }

  public Control _this(org.omg.CORBA.ORB orb) 
  {
    return ControlHelper.narrow(
    super._this_object(orb));
  }


} // class ControlPOA
