Package akka.transactor

Examples of akka.transactor.Atomically


        }
        failer = (TypedCounter) TypedActor.newInstance(TypedCounter.class, FailerImpl.class);
    }

    @Test public void incrementAllCountersWithSuccessfulTransaction() {
        Coordination.coordinate(true, new Atomically() {
            public void atomically() {
                for (TypedCounter counter : counters) {
                    counter.increment();
                }
            }
View Full Code Here


        }
    }

    @Test public void incrementNoCountersWithFailingTransaction() {
        try {
            Coordination.coordinate(true, new Atomically() {
                public void atomically() {
                    for (TypedCounter counter : counters) {
                        counter.increment();
                    }
                    failer.increment();
View Full Code Here

                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() {
                            public void run() { latch.countDown(); }
                        });
View Full Code Here

            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

Related Classes of akka.transactor.Atomically

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.