Package org.apache.tuscany.container.java.mock.components

Examples of org.apache.tuscany.container.java.mock.components.RequestScopeComponentImpl


        RequestScopeContext scope = new RequestScopeContext(ctx);
        scope.registerFactories(createConfigurations());
        scope.start();

        // first request
        RequestScopeComponentImpl comp1 = (RequestScopeComponentImpl) scope.getContext("TestService1").getInstance(null);
        Assert.assertNotNull(comp1);
        Object id = new Object();
        scope.onEvent(new RequestEnd(this,id));

        // second request
        RequestScopeComponentImpl comp2 = (RequestScopeComponentImpl) scope.getContext("TestService1").getInstance(null);
        Assert.assertNotNull(comp2);
        Assert.assertNotSame(comp1, comp2);
        Object id2 = new Object();
        scope.onEvent(new RequestEnd(this,id2));
View Full Code Here


        EventContext ctx = new EventContextImpl();
        RequestScopeContext scope = new RequestScopeContext(ctx);
        scope.registerFactories(createConfigurations());
        scope.start();

        RequestScopeComponentImpl comp1 = (RequestScopeComponentImpl) scope.getContext("TestService1").getInstance(null);
        Assert.assertNotNull(comp1);
        Object id = new Object();
        scope.onEvent(new RequestEnd(this,id));

        // second request
View Full Code Here

TOP

Related Classes of org.apache.tuscany.container.java.mock.components.RequestScopeComponentImpl

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.