示例#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();
    }
  }