Package org.akka.essentials.stm.transactor.example.msg

Examples of org.akka.essentials.stm.transactor.example.msg.AccountCredit


      final TransferMsg transfer = (TransferMsg) message;   
      final Coordinated coordinated = new Coordinated(timeout);
      coordinated.atomic(new Runnable() {
        public void run() {
          // credit amount - will always be successful
          to.tell(coordinated.coordinate(new AccountCredit(transfer
              .getAmtToBeTransferred())));
          // debit amount - throws an exception if funds insufficient
          from.tell(coordinated.coordinate(new AccountDebit(transfer
              .getAmtToBeTransferred())));
        }
View Full Code Here


        });

      } else if (message instanceof AccountCredit) {
        coordinated.atomic(new Runnable() {
          public void run() {
            AccountCredit accCredit = (AccountCredit) message;
            float bal = balance.get() + accCredit.getAmount();
            balance.set(bal);
          }
        });
      }
    } else if (o instanceof AccountBalance) {
View Full Code Here

TOP

Related Classes of org.akka.essentials.stm.transactor.example.msg.AccountCredit

Copyright © 2018 www.massapicom. 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.