Package org.agilewiki.jactor2.core.reactors

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


public class TSSMTransactionTest extends CallTestBase {
    public void testI() throws Exception {
        new Plant();
        try {
            final TSSMReference<String> propertiesReference = new TSSMReference<String>();
            final CommonReactor reactor = new NonBlockingReactor();

            final RequestBus<TSSMChanges<String>> validationBus = propertiesReference.validationBus;
            call(new SubscribeAOp<TSSMChanges<String>>(validationBus,
                    reactor) {
                @Override
View Full Code Here


        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

*/
@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

    }

    @Override
    public void addReactor(final ReactorImpl _reactorImpl) {
        if (closing) {
            throw new ReactorClosedException("Closeable is closed");
        }
        closers.put(_reactorImpl, Boolean.TRUE);
    }
View Full Code Here

TOP

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

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.