package seqOfComplex;

/**
 * <ul>
 * <li> <b>IDL Source</b>    "seqOfComplexTest.idl"
 * <li> <b>IDL Name</b>      ::seqOfComplex::SeqOfComplexTest
 * <li> <b>Repository Id</b> IDL:seqOfComplex/SeqOfComplexTest:1.0
 * </ul>
 * <b>IDL definition:</b>
 * <pre>
 * interface SeqOfComplexTest {
  ...
};
 * </pre>
 */
public abstract class SeqOfComplexTestPOA extends org.omg.PortableServer.Servant implements 
  org.omg.CORBA.portable.InvokeHandler, seqOfComplex.SeqOfComplexTestOperations {

  public seqOfComplex.SeqOfComplexTest _this () {
   return seqOfComplex.SeqOfComplexTestHelper.narrow(super._this_object());
  }

  public seqOfComplex.SeqOfComplexTest _this (org.omg.CORBA.ORB orb) {
    return seqOfComplex.SeqOfComplexTestHelper.narrow(super._this_object(orb));
  }

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

  private static java.lang.String[] __ids = {
    "IDL:seqOfComplex/SeqOfComplexTest:1.0"
  };

  private static java.util.Dictionary _methods = new java.util.Hashtable();

  static {
    _methods.put("testSeqOfComplex", new com.inprise.vbroker.CORBA.portable.MethodPointer(0, 0));
  }

  public org.omg.CORBA.portable.OutputStream _invoke (java.lang.String opName,
                                                      org.omg.CORBA.portable.InputStream _input,
                                                      org.omg.CORBA.portable.ResponseHandler handler) {
    com.inprise.vbroker.CORBA.portable.MethodPointer method =
      (com.inprise.vbroker.CORBA.portable.MethodPointer) _methods.get(opName);
    if (method == null) {
      throw new org.omg.CORBA.BAD_OPERATION();
    }
    switch (method.interface_id) {
      case 0: {
        return seqOfComplex.SeqOfComplexTestPOA._invoke(this, method.method_id, _input, handler);
      }
    }
    throw new org.omg.CORBA.BAD_OPERATION();
  }

  public static org.omg.CORBA.portable.OutputStream _invoke (seqOfComplex.SeqOfComplexTestOperations _self,
                                                             int _method_id,
                                                             org.omg.CORBA.portable.InputStream _input,
                                                             org.omg.CORBA.portable.ResponseHandler _handler) {
    org.omg.CORBA.portable.OutputStream _output = null;
    {
      switch (_method_id) {
      case 0: {
        seqOfComplex.BasicStruct[] inBasicStructSeq;
        inBasicStructSeq = seqOfComplex.BasicStructSeqHelper.read(_input);
        seqOfComplex.BasicStructSeqHolder inoutBasicStructSeq = new seqOfComplex.BasicStructSeqHolder();
        inoutBasicStructSeq.value = seqOfComplex.BasicStructSeqHelper.read(_input);
        seqOfComplex.BasicStructSeqHolder outBasicStructSeq = new seqOfComplex.BasicStructSeqHolder();
        int _result = _self.testSeqOfComplex(inBasicStructSeq, inoutBasicStructSeq, 
                                             outBasicStructSeq);
        _output = _handler.createReply();
        _output.write_long((int)_result);
        seqOfComplex.BasicStructSeqHelper.write(_output, inoutBasicStructSeq.value);
        seqOfComplex.BasicStructSeqHelper.write(_output, outBasicStructSeq.value);
        return _output;
      }
      }
      throw new org.omg.CORBA.BAD_OPERATION();
    }
  }
}
