Пример #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();
    }
  }
 // DSI Dispatch call
 public void invoke(org.omg.CORBA.ServerRequest r) {
   switch (((java.lang.Integer) _methods.get(r.op_name())).intValue()) {
     case 0: // kxml.util.remote.RemoteObservable.deleteObserver
       {
         org.omg.CORBA.NVList _list = _orb().create_list(0);
         org.omg.CORBA.Any _observer = _orb().create_any();
         _observer.type(kxml.util.remote.RemoteObserverHelper.type());
         _list.add_value("observer", _observer, org.omg.CORBA.ARG_IN.value);
         r.params(_list);
         kxml.util.remote.RemoteObserver observer;
         observer = kxml.util.remote.RemoteObserverHelper.extract(_observer);
         this.deleteObserver(observer);
         org.omg.CORBA.Any __return = _orb().create_any();
         __return.type(_orb().get_primitive_tc(org.omg.CORBA.TCKind.tk_void));
         r.result(__return);
       }
       break;
     case 1: // kxml.util.remote.RemoteObservable.addObserver
       {
         org.omg.CORBA.NVList _list = _orb().create_list(0);
         org.omg.CORBA.Any _observer = _orb().create_any();
         _observer.type(kxml.util.remote.RemoteObserverHelper.type());
         _list.add_value("observer", _observer, org.omg.CORBA.ARG_IN.value);
         r.params(_list);
         kxml.util.remote.RemoteObserver observer;
         observer = kxml.util.remote.RemoteObserverHelper.extract(_observer);
         this.addObserver(observer);
         org.omg.CORBA.Any __return = _orb().create_any();
         __return.type(_orb().get_primitive_tc(org.omg.CORBA.TCKind.tk_void));
         r.result(__return);
       }
       break;
     default:
       throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
   }
 }