Beispiel #1
0
  public void invoke(
      org.omg.CORBA.ServerRequest request) { // Ensure that the operation name is correct
    System.out.println("invocato metodo " + request.operation() + " in AccounManagerImpl");
    Float balance;
    String name = new String(_object_id());

    if (request.operation().equals("open")) {
      org.omg.CORBA.NVList params = orb.create_list(1);
      org.omg.CORBA.Any any = orb.create_any();
      any.insert_string(new String(""));
      params.add_value("nomeFile", any, org.omg.CORBA.ARG_IN.value);
      request.arguments(params);
      try {
        name = params.item(0).value().extract_string();
      } catch (Exception e) {
        System.out.println("ERRORE:");
        e.printStackTrace();
      }
      // Invoke the actual implementation and fill out the result
      org.omg.CORBA.Object account = open(name);
      org.omg.CORBA.Any result = orb.create_any();
      result.insert_Object(account);
      request.set_result(result);
    } else {
      System.out.println("Errore nell'ivocazione dinamica del metodo open");
      throw new org.omg.CORBA.BAD_PARAM();
    }
  }
 public void invoke(org.omg.CORBA.ServerRequest _request) {
   java.lang.Object _method = _methods.get(_request.operation());
   if (_method == null) {
     throw new org.omg.CORBA.BAD_OPERATION(_request.operation());
   }
   int _method_id = ((java.lang.Integer) _method).intValue();
   switch (_method_id) {
     case 0:
       {
         org.omg.CORBA.NVList _params = _orb().create_list(0);
         _request.arguments(_params);
         java.lang.String _result = this.sayHello();
         org.omg.CORBA.Any _resultAny = _orb().create_any();
         _resultAny.insert_string(_result);
         _request.set_result(_resultAny);
         return;
       }
   }
 }