package primativeAnyTest;

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

  public primativeAnyTest.pat _this () {
   return primativeAnyTest.patHelper.narrow(super._this_object());
  }

  public primativeAnyTest.pat _this (org.omg.CORBA.ORB orb) {
    return primativeAnyTest.patHelper.narrow(super._this_object(orb));
  }

  public java.lang.String[] _ids () {
    return __ids;
  }

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

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

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

  static {
    _methods.put("testPrimativeAny", 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 primativeAnyTest.patPOA._invoke(this, method.method_id, _input, handler);
      }
    }
    throw new org.omg.CORBA.BAD_OPERATION();
  }

  public static org.omg.CORBA.portable.OutputStream _invoke (primativeAnyTest.patOperations _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: {
        org.omg.CORBA.Any inPrimativeAny;
        inPrimativeAny = _input.read_any();
        org.omg.CORBA.AnyHolder inoutPrimativeAny = new org.omg.CORBA.AnyHolder();
        inoutPrimativeAny.value = _input.read_any();
        org.omg.CORBA.AnyHolder outPrimativeAny = new org.omg.CORBA.AnyHolder();
        int _result = _self.testPrimativeAny(inPrimativeAny, inoutPrimativeAny, 
                                             outPrimativeAny);
        _output = _handler.createReply();
        _output.write_long((int)_result);
        _output.write_any((org.omg.CORBA.Any)inoutPrimativeAny.value);
        _output.write_any((org.omg.CORBA.Any)outPrimativeAny.value);
        return _output;
      }
      }
      throw new org.omg.CORBA.BAD_OPERATION();
    }
  }
}
