コード例 #1
0
  @Override
  public boolean transferMoney(int from, int to, Money amount) {
    try {
      Money negative = Money.difference(new Money(0, amount.getCurrency()), amount);
      for (IBank bank : banken) {
        if (bank.getRekening(from) != null) {
          bank.maakOver(from, negative);
        }
        if (bank.getRekening(to) != null) {
          bank.maakOver(to, amount);
        }
      }

      bp.inform(this, "overgemaakt", null, amount);
      return true;

    } catch (Exception e) {
      System.err.println(e.toString());
    }

    return false;
  }
コード例 #2
0
 @Override
 public void removeListener(RemotePropertyListener listener, String property)
     throws RemoteException {
   bp.removeListener(listener, property);
 }
コード例 #3
0
 @Override
 public void propertyChange(PropertyChangeEvent evt) throws RemoteException {
   System.out.println("Centrale informed");
   bp.inform(this, "overgemaakt", null, null);
 }