Examples of RequestEnd


Examples of org.apache.tuscany.core.component.event.RequestEnd

                Target target2 = (Target) wireService.createProxy(wire);
                assertEquals(null, service2.getString());
                service2.setString("bar");
                assertEquals("bar", service2.getString());
                assertEquals("bar", target2.getString());
                scope.onEvent(new RequestEnd(this));
            }
        }, null);
        executor.execute(future);
        future.get();

        assertEquals("foo", service.getString());
        scope.onEvent(new RequestEnd(this));
        scope.stop();
    }
View Full Code Here

Examples of org.apache.tuscany.core.component.event.RequestEnd

        assertTrue(o1.isInitialized());
        assertFalse(o1.isDestroyed());
        RequestScopeInitDestroyComponent o2 =
            (RequestScopeInitDestroyComponent) scopeContext.getInstance(atomicContext);
        assertSame(o1, o2);
        scopeContext.onEvent(new RequestEnd(this));
        assertTrue(o1.isDestroyed());
        scopeContext.stop();
    }
View Full Code Here

Examples of org.apache.tuscany.core.component.event.RequestEnd

        SystemAtomicComponent atomicContext = createContext(scopeContext);

        RequestScopeInitDestroyComponent o1 =
            (RequestScopeInitDestroyComponent) scopeContext.getInstance(atomicContext);
        assertTrue(o1.isInitialized());
        scopeContext.onEvent(new RequestEnd(this));
        assertTrue(o1.isDestroyed());

        RequestScopeInitDestroyComponent o2 =
            (RequestScopeInitDestroyComponent) scopeContext.getInstance(atomicContext);
        assertNotSame(o1, o2);
        scopeContext.onEvent(new RequestEnd(this));
        assertTrue(o2.isDestroyed());
        scopeContext.stop();
    }
View Full Code Here

Examples of org.apache.tuscany.core.component.event.RequestEnd

        Assert.assertTrue(initOnly.isInitialized());
        Assert.assertFalse(initDestroy.isDestroyed());
        Assert.assertFalse(destroyOnly.isDestroyed());

        // expire module
        scope.onEvent(new RequestEnd(this));

        Assert.assertTrue(initDestroy.isDestroyed());
        Assert.assertTrue(destroyOnly.isDestroyed());

        scope.stop();
View Full Code Here

Examples of org.apache.tuscany.core.component.event.RequestEnd

        Assert.assertNotNull(three);
        Assert.assertEquals(3, three.getNumberInstantiated());
        Assert.assertEquals(3, three.getInitOrder());

        // expire module
        scope.onEvent(new RequestEnd(this));
        Assert.assertEquals(0, one.getNumberInstantiated());
        scope.stop();
    }
View Full Code Here

Examples of org.apache.tuscany.core.component.event.RequestEnd

        OrderedEagerInitPojo three = (OrderedEagerInitPojo) scope.getInstance(threeCtx);
        Assert.assertNotNull(three);

        // expire module
        scope.onEvent(new RequestEnd(this));
        Assert.assertEquals(0, one.getNumberInstantiated());
        scope.stop();
    }
View Full Code Here

Examples of org.apache.tuscany.core.context.event.RequestEnd

        Object id = new Object();
        child.publish(new RequestStart(this, id));
        HelloWorldService service1 = (HelloWorldService) child.getContext("target").getInstance(null);
        Assert.assertEquals("foo", service1.hello("foo"));

        child.publish(new RequestEnd(this, id));
        child.publish(new ModuleStop(this));
        runtime.stop();

    }
View Full Code Here

Examples of org.apache.tuscany.core.context.event.RequestEnd

     * Disassociate the module context from the current thread and shut down the runtime.
     */
    @Override
    public void stop() {
        setModuleContext(null);
        moduleContext.publish(new RequestEnd(this, new Object()));
        moduleContext.publish(new HttpSessionEnd(this, sessionKey));
        moduleContext.publish(new ModuleStop(this));
        moduleContext.stop();
        monitor.moduleStopped(moduleContext.getName());
    }
View Full Code Here

Examples of org.apache.tuscany.core.context.event.RequestEnd

            throw new ServletException(e);

        } finally {
            try {
                // End processing the request
                moduleContext.publish(new RequestEnd(this, request));
            } catch (Exception e) {
                throw new ServletException(e);
            }
            ContextBinder.BINDER.setContext(oldContext);
        }
View Full Code Here

Examples of org.apache.tuscany.core.context.event.RequestEnd

                .getInstance(null);
        SessionScopeComponent comp3 = (SessionScopeComponent) scope.getContextByKey("TestService1", session)
                .getInstance(null);
        Assert.assertNotNull(comp2);
        Object id = new Object();
        scope.onEvent(new RequestEnd(this, id));
        Assert.assertSame(comp1, comp2); // should be same instances
        Assert.assertSame(comp2, comp3); // should not be same instances
        ctx.clearIdentifier(HttpSessionEvent.HTTP_IDENTIFIER);

        // shutdown sessions
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.