Examples of AccountBalance


Examples of org.akka.essentials.stm.transactor.example2.msg.AccountBalance

  @Override
  public void onReceive(Object message) throws Exception {
    if (message instanceof TransferMsg) {
      transfer.tell(message);
    } else if (message instanceof AccountBalance) {
      AccountBalance account = (AccountBalance) Await.result(
          ask(transfer, message, 5000), Duration.create("5 second"));

      System.out.println("Account #" + account.getAccountNumber()
          + " , Balance " + account.getBalance());

      getSender().tell(account);
    } else if (message instanceof AccountMsg) {
      transfer.tell(message);
    }
View Full Code Here

Examples of org.akka.essentials.stm.transactor.example2.msg.AccountBalance

              .getAmtToBeTransferred())));
        }
      });
    } else if (message instanceof AccountBalance) {

      AccountBalance accBalance = (AccountBalance) message;
      // check the account number and return the balance
      if (accBalance.getAccountNumber().equals(fromAccount)) {
        from.tell(accBalance, sender());
      }
      if (accBalance.getAccountNumber().equals(toAccount)) {
        to.tell(accBalance, sender());
      }
    }else if(message instanceof AccountMsg){
      from.tell(message);
    }
View Full Code Here

Examples of org.akka.essentials.stm.transactor.example2.msg.AccountBalance

  // method.
  @Override
  public boolean normally(Object message) {
    if (message instanceof AccountBalance) {
      // reply with the account balance
      sender().tell(new AccountBalance(accountNumber, balance.get()));
      return true;
    }
    return false;
  }
View Full Code Here

Examples of org.akka.essentials.stm.transactor.example2.msg.AccountBalance

  }

  private void showBalances() {
    try {
      Thread.sleep(2000);
      bank.tell(new AccountBalance("XYZ"));
      bank.tell(new AccountBalance("ABC"));

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

Examples of org.jclouds.cloudsigma2.domain.AccountBalance

                  .build(),
            responseBuilder()
                  .payload(payloadFromResourceWithContentType("/balance.json", MediaType.APPLICATION_JSON))
                  .build());

      AccountBalance result = api.getAccountBalance();
      assertNotNull(result);
   }
View Full Code Here

Examples of org.jclouds.cloudsigma2.domain.AccountBalance

                  .build(),
            responseBuilder()
                  .payload(payloadFromResourceWithContentType("/balance.json", MediaType.APPLICATION_JSON))
                  .build());

      AccountBalance result = api.getAccountBalance();
      assertNotNull(result);
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.