
/**
* ShapeListPOA.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from Shape.idl
* lunedì 22 ottobre 2018 11.37.55 CEST
*/

public abstract class ShapeListPOA extends org.omg.PortableServer.Servant
 implements ShapeListOperations, org.omg.CORBA.portable.InvokeHandler
{

  // Constructors

  private static java.util.Hashtable _methods = new java.util.Hashtable ();
  static
  {
    _methods.put ("newShape", new java.lang.Integer (0));
    _methods.put ("allShapes", new java.lang.Integer (1));
    _methods.put ("getVersion", new java.lang.Integer (2));
  }

  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:  // ShapeList/newShape
       {
         try {
           GraphicalObject g = GraphicalObjectHelper.read (in);
           Shape $result = null;
           $result = this.newShape (g);
           out = $rh.createReply();
           ShapeHelper.write (out, $result);
         } catch (ShapeListPackage.FullException $ex) {
           out = $rh.createExceptionReply ();
           ShapeListPackage.FullExceptionHelper.write (out, $ex);
         }
         break;
       }

       case 1:  // ShapeList/allShapes
       {
         Shape $result[] = null;
         $result = this.allShapes ();
         out = $rh.createReply();
         AllHelper.write (out, $result);
         break;
       }

       case 2:  // ShapeList/getVersion
       {
         int $result = (int)0;
         $result = this.getVersion ();
         out = $rh.createReply();
         out.write_long ($result);
         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:ShapeList:1.0"};

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

  public ShapeList _this() 
  {
    return ShapeListHelper.narrow(
    super._this_object());
  }

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


} // class ShapeListPOA
