Package org.agilewiki.jactor2.core.impl

Examples of org.agilewiki.jactor2.core.impl.Plant


    }
}

class A1 extends AOp<Void> {
    A1(final String _name) throws Exception {
        super(_name, new NonBlockingReactor());
    }
View Full Code Here


public class HungRequestTest extends CallTestBase {
    public void testa() throws Exception {
        new Plant();
        try {
            final Hanger blade1 = new Hanger(new NonBlockingReactor());
            try {
                call(blade1.hiAOp());
            } catch (final ReactorClosedException sce) {
            }
            final Hung blade2 = new Hung(new NonBlockingReactor(), new Hanger(
                    new NonBlockingReactor()));
            try {
                call(blade2.hoAOp());
            } catch (final ReactorClosedException sce) {
            }
        } finally {
View Full Code Here

public class PubSubSample {
    public static void main(final String[] args) throws Exception {
        final Plant plant = new Plant();
        try {
            NonBlockingReactor reactor = new NonBlockingReactor();
            RequestBus<String> requestBus =
                    new RequestBus<String>(reactor);
            new SubscribeAOp<String>(requestBus, reactor) {
                @Override
                protected void processContent(String _content) throws Exception {
View Full Code Here

public class PubSubTest extends CallTestBase {
    public void testI() throws Exception {
        System.out.println("I");
        new Plant();
        try {
            final NonBlockingReactor reactor = new NonBlockingReactor();
            final RequestBus<Void> requestBus = new RequestBus<Void>(reactor);
            call(requestBus.signalsContentSOp(null));
            final Subscription<Void> s1 = call(new SubscribeAOp<Void>(
                    requestBus, reactor) {
                @Override
View Full Code Here

    public void testJ() throws Exception {
        System.out.println("J");
        new Plant();
        try {
            final AtomicInteger counter = new AtomicInteger();
            final NonBlockingReactor busReactor = new NonBlockingReactor();
            final CommonReactor subscriberReactor = new NonBlockingReactor();
            final RequestBus<Void> requestBus = new RequestBus<Void>(busReactor);
            call(requestBus.sendsContentAOp(null));
            assertEquals(counter.get(), 0);
            call(new SubscribeAOp<Void>(requestBus, subscriberReactor) {
                @Override
                protected void processContent(final Void _content,
                                              AsyncRequestImpl _asyncRequestImpl,
                                              AsyncResponseProcessor<Void> _asyncResponseProcessor)
                        throws Exception {
                    System.out.println("ping");
                    counter.incrementAndGet();
                    _asyncResponseProcessor.processAsyncResponse(null);
                }
            });
            call(requestBus.sendsContentAOp(null));
            assertEquals(counter.get(), 1);
            subscriberReactor.close();
            try {
                call(requestBus.sendsContentAOp(null));
            } catch (final ReactorClosedException e) {
            }
            assertEquals(counter.get(), 1);
View Full Code Here

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

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

TOP

Related Classes of org.agilewiki.jactor2.core.impl.Plant

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.