Examples of coordinate()


Examples of akka.transactor.Coordinated.coordinate()

      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

Examples of akka.transactor.Coordinated.coordinate()

        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())));
        }
      });
    } else if (message instanceof AccountBalance) {
View Full Code Here

Examples of akka.transactor.Coordinated.coordinate()

      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

Examples of akka.transactor.Coordinated.coordinate()

        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())));
        }
      });
    } else if (message instanceof AccountBalance) {
View Full Code Here

Examples of akka.transactor.Coordinated.coordinate()

                Increment increment = (Increment) message;
                List<ActorRef> friends = increment.getFriends();
                final CountDownLatch latch = increment.getLatch();
                if (!friends.isEmpty()) {
                    Increment coordMessage = new Increment(friends.subList(1, friends.size()), latch);
                    friends.get(0).sendOneWay(coordinated.coordinate(coordMessage));
                }
                coordinated.atomic(new Atomically(txFactory) {
                    public void atomically() {
                        increment();
                        StmUtils.scheduleDeferredTask(new Runnable() {
View Full Code Here

Examples of akka.transactor.Coordinated.coordinate()

            Coordinated coordinated = (Coordinated) incoming;
            Object message = coordinated.getMessage();
            if (message instanceof Increment) {
                Increment increment = (Increment) message;
                if (increment.hasFriend()) {
                    increment.getFriend().sendOneWay(coordinated.coordinate(new Increment()));
                }
                coordinated.atomic(new Atomically() {
                    public void atomically() {
                        increment();
                    }
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.