Package org.agilewiki.jactor2.core.impl

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


        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

     * Create the Plant's internal reactor.
     *
     * @return The reactor belonging to the singleton.
     */
    protected Facility createInternalFacility() throws Exception {
        return new Facility(PLANT_INTERNAL_FACILITY_NAME, null,
                plantConfiguration.getInitialBufferSize(),
                plantConfiguration.getInitialLocalMessageQueueSize());
    }
View Full Code Here

     * Create an ImmutableReference blade.
     *
     * @param _transmutable The transmutable data structure to be operated on.
     */
    public TransmutableReference(final TRANSMUTABLE _transmutable) throws Exception {
        reactor = new IsolationReactor();
        transmutable = _transmutable;
        unmodifiable = transmutable.createUnmodifiable();
    }
View Full Code Here

     * @param _transmutable  The transmutable data structure to be operated on.
     * @param _parentReactor The parent of the blade's reactor.
     */
    public TransmutableReference(final TRANSMUTABLE _transmutable,
                                 final NonBlockingReactor _parentReactor) throws Exception {
        reactor = new IsolationReactor(_parentReactor);
        transmutable = _transmutable;
        unmodifiable = transmutable.createUnmodifiable();
    }
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 class BladeC {
    private final Reactor reactor;

    public BladeC() throws Exception {
        this.reactor = new IsolationReactor();
    }
View Full Code Here

    long t0;

    public FirstStage(final DataProcessor _next, final long _count,
            final int _maxWindowSize) throws Exception {
        super(new IsolationReactor());
        getReactor().setIdle(this);
        mainThread = Thread.currentThread();
        next = _next;
        count = _count;
        maxWindowSize = _maxWindowSize;
View Full Code Here

* Test code.
*/
public class Test1 extends CallTestBase {
    public void testa() throws Exception {
        new Plant();
        final IsolationReactor reactor = new IsolationReactor();
        final Blade11 blade1 = new Blade11(reactor);
        final String result = call(blade1.hiSOp());
        assertEquals("Hello world!", result);
        Plant.close();
    }
View Full Code Here

    public void test1() throws Exception {
        Thread.sleep(100);
        System.err.println("\ntest 1");
        new Plant();
        try {
            Foot foot = new Foot(new IsolationReactor());
            assertTrue(call(foot.dAOp()));
        } finally {
            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.