Examples of JAIterator


Examples of org.agilewiki.jactor.JAIterator

     * @param rp      The response processor.
     * @throws Exception Any exceptions raised while executing the state machine.
     */
    public void execute(Object request, RP rp) throws Exception {
        this.request = request;
        (new JAIterator() {
            @Override
            protected void process(final RP rp1) throws Exception {
                if (programCounter >= smBuilder.operationsSize()) rp1.processResponse(JANull.jan);
                else {
                    final _Operation o = smBuilder.getOperation(programCounter);
View Full Code Here

Examples of org.agilewiki.jactor.JAIterator

        final Calculator calculator = new Calculator();
        calculator.initialize(getMailbox());
        send(calculator, new Set(1), new RP() {
            @Override
            public void processResponse(Object response) throws Exception {
                JAIterator it = new JAIterator() {
                    int max = factorial.getValue();
                    int count = 0;

                    @Override
                    protected void process(final RP rp1) throws Exception {
                        if (count == max) {
                            send(calculator, new Get(), rp1);
                            return;
                        }
                        count += 1;
                        send(calculator, new Multiply(count), new RP() {
                            @Override
                            public void processResponse(Object response) throws Exception {
                                rp1.processResponse(null);
                            }
                        });
                    }
                };
                it.iterate(rp);
            }
        });
    }
View Full Code Here

Examples of org.agilewiki.jactor.JAIterator

        burst = b;
    }

    @Override
    public void processRequest(final SimpleRequest unwrappedRequest, final RP rd1) throws Exception {
        (new JAIterator() {
            int i;

            @Override
            public void process(final RP rd2) throws Exception {
                if (i > count) rd2.processResponse(this);
View Full Code Here

Examples of org.agilewiki.jactor.JAIterator

    }

    @Override
    public void processRequest(final RealRequest unwrappedRequest, final RP rd1) throws Exception {
        final boolean real = unwrappedRequest != null;
        (new JAIterator() {
            int i;

            @Override
            public void process(final RP rd2) throws Exception {
                if (i > count) rd2.processResponse(this);
View Full Code Here

Examples of org.agilewiki.jactor.JAIterator

    }

    @Override
    public void processRequest(final SimpleRequest unwrappedRequest, final RP rd1)
            throws Exception {
        (new JAIterator() {
            int i;

            @Override
            public void process(final RP rd2) throws Exception {
                if (i > count) rd2.processResponse(this);
View Full Code Here

Examples of org.agilewiki.jactor.JAIterator

    }

    @Override
    public void processRequest(final RealRequest unwrappedRequest, final RP rd1)
            throws Exception {
        (new JAIterator() {
            int i;

            @Override
            public void process(final RP rd2) throws Exception {
                if (i > count) rd2.processResponse(this);
View Full Code Here

Examples of org.agilewiki.jactor.JAIterator

                if (d > 0) System.out.println("iterations per sec = " + c * 1000L / d);
                System.out.println("each iteration takes " + d * 1000000. / c + " nanoseconds");
            }
        };

        (new JAIterator() {
            long i;

            @Override
            protected void process(RP rp) throws Exception {
                i += 1;
View Full Code Here

Examples of org.agilewiki.jactor.JAIterator

            public void processResponse(Object rsp) {
                System.out.println(rsp);
            }
        };

        (new JAIterator() {
            int i;
            int r = 1;

            public void process(RP rp) throws Exception {
                if (i >= max) rp.processResponse(new Integer(r));
View Full Code Here

Examples of org.agilewiki.jactor.JAIterator

            throws Exception {
        super.initialize(mailbox);
        smb.add(new _Operation() {
            @Override
            public void call(final SimpleMachine sm, final RP rp1) throws Exception {
                JAIterator it = new JAIterator() {
                    long i = 0;

                    @Override
                    protected void process(RP rp1) throws Exception {
                        if (i == runs) rp1.processResponse(this);
                        else {
                            i += 1;
                            AddCount addCount = new AddCount();
                            addCount.number = 100L;
                            addCount.send(Driver.this, counterActor, rp1);
                        }
                    }
                };
                it.iterate(new RP() {
                    @Override
                    public void processResponse(Object response) throws Exception {
                        rp1.processResponse(null);
                    }
                });
View Full Code Here

Examples of org.agilewiki.jactor.JAIterator

                rp.processResponse(null);
            }
        };
        final Multiplier mp = new Multiplier();
        mp.initialize(getMailbox());
        (new JAIterator() {
            int i;
            int r = 1;

            public void process(RP rp) throws Exception {
                if (i >= max) rp.processResponse(new Integer(r));
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.