Package org.agilewiki.jactor2.core.reactors

Examples of org.agilewiki.jactor2.core.reactors.NonBlockingReactor


        this(new TSSMap<VALUE>(_sortedMap), _parentReactor);
    }

    private TSSMReference(TSSMap<VALUE> _tssMap) throws Exception {
        super(_tssMap);
        final NonBlockingReactor parentReactor = (NonBlockingReactor) getReactor()
                .getParentReactor();
        validationBus = new RequestBus<TSSMChanges<VALUE>>(parentReactor);
        changeBus = new RequestBus<TSSMChanges<VALUE>>(parentReactor);
    }
View Full Code Here


        changeBus = new RequestBus<TSSMChanges<VALUE>>(parentReactor);
    }

    private TSSMReference(TSSMap<VALUE> _tssMap, IsolationReactor _reactor) throws Exception {
        super(_tssMap, _reactor);
        final NonBlockingReactor parentReactor = (NonBlockingReactor) getReactor()
                .getParentReactor();
        validationBus = new RequestBus<TSSMChanges<VALUE>>(parentReactor);
        changeBus = new RequestBus<TSSMChanges<VALUE>>(parentReactor);
    }
View Full Code Here

    public void testReactor() throws Exception {
        System.out.println("R");
        new Plant();
        try {
            final Reactor reactor = new NonBlockingReactor();

            final MyCloseable mac1 = new MyCloseable();
            final MyCloseable mac2 = new MyCloseable();
            final MyCloseable mac3 = new MyCloseable();
            final MyCloseable mac4 = new MyCloseable();
            final MyFailedCloseable mfac = new MyFailedCloseable();
            reactor.addCloseable(mac1);
            reactor.addCloseable(mac2);
            reactor.addCloseable(mac3);
            reactor.addCloseable(mac4);
            reactor.addCloseable(mfac);
            reactor.removeCloseable(mac4);

            reactor.close();

            assertEquals(mac1.closed, 1);
            assertEquals(mac2.closed, 1);
            assertEquals(mac3.closed, 1);
            assertEquals(mac4.closed, 0);
View Full Code Here

public class NonBlockingBladeBase extends BladeBase implements NonBlockingBlade {
    /**
     * Create a non-blocking blade and a non-blocking reactor whose parent is the internal reactor of Plant.
     */
    public NonBlockingBladeBase() throws Exception {
        _initialize(new NonBlockingReactor());
    }
View Full Code Here

import org.agilewiki.jactor2.core.requests.SOp;
import org.agilewiki.jactor2.core.requests.impl.RequestImpl;

class Hanger extends NonBlockingBladeBase {
    Hanger() throws Exception {
        super(new NonBlockingReactor());
    }
View Full Code Here

    }

    static public void main(final String[] _args) throws Exception {
        new Plant();
        try {
            new OneRuntime().new OneWaySOp("direct", new NonBlockingReactor()).signal();
            new OneWayError().new IndirectAOp("indirect", new NonBlockingReactor()).call();
            System.out.println("ok");
        } finally {
            Plant.close();
        }
    }
View Full Code Here

*/
@GwtIncompatible
public class Test1 extends CallTestBase {
    public void testI() throws Exception {
        new Plant();
        final Reactor reactor = new IsolationReactor();
        final BladeA bladeA = new BladeA(reactor);
        try {
            call(bladeA.throwAOp);
        } catch (final IOException se) {
            Plant.close();
View Full Code Here

    public void testReactor() throws Exception {
        System.out.println("R");
        new Plant();
        try {
            final Reactor reactor = new NonBlockingReactor();

            final MyCloseable mac1 = new MyCloseable();
            final MyCloseable mac2 = new MyCloseable();
            final MyCloseable mac3 = new MyCloseable();
            final MyCloseable mac4 = new MyCloseable();
            final MyFailedCloseable mfac = new MyFailedCloseable();
            reactor.addCloseable(mac1);
            reactor.addCloseable(mac2);
            reactor.addCloseable(mac3);
            reactor.addCloseable(mac4);
            reactor.addCloseable(mfac);
            reactor.removeCloseable(mac4);

            reactor.close();

            assertEquals(mac1.closed, 1);
            assertEquals(mac2.closed, 1);
            assertEquals(mac3.closed, 1);
            assertEquals(mac4.closed, 0);
View Full Code Here

     * if the reactor is not a common reactor, sends a response of null via
     * a bound response processor.
     */
    public void onCancel() {
        cancelAll();
        final Reactor targetReactor = getTargetReactor();
        if (!(targetReactor instanceof CommonReactor)) {
            try {
                new BoundResponseProcessor<RESPONSE_TYPE>(targetReactor, this)
                        .processAsyncResponse(null);
            } catch (final Exception e) {
View Full Code Here

     * @return True when the closeable was added to the list.
     */
    @Override
    public boolean addCloseable(final Closeable _closeable) {
        if (startedClosing()) {
            throw new ReactorClosedException(
                    "call to addCloseable when reactor already started closing: "
                            + reason);
        }
        if (this == _closeable) {
            return false;
View Full Code Here

TOP

Related Classes of org.agilewiki.jactor2.core.reactors.NonBlockingReactor

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.