Package org.apache.tuscany.core.component.scope

Examples of org.apache.tuscany.core.component.scope.ModuleScopeContainer.register()


                                                                      properties,
                                                                      null,
                                                                      scope,
                                                                      ArtifactFactory.createWireService(),
                                                                      null);
        scope.register(context);
        DataType<String> returnDataType = new DataType<String>(String.class, String.class.getName());
//        Operation<String> operation = new Operation<String>("greet",
//                                                        returnDataType,
//                                                        null,
//                                                        null,
View Full Code Here


                                                                      properties,
                                                                      null,
                                                                      scope,
                                                                      ArtifactFactory.createWireService(),
                                                                      null);
        scope.register(context);

        InboundWire wire = ArtifactFactory.createInboundWire("Greeting",
                                                                Greeting.class);
        ArtifactFactory.terminateWire(wire);
        for (InboundInvocationChain chain : wire.getInvocationChains().values()) {
View Full Code Here

        List<Class<?>> services = new ArrayList<Class<?>>();
        services.add(Greeting.class);
        JavaScriptComponent context =
            new JavaScriptComponent("source", implClass2, new HashMap<String, Object>(), services, null, scope,
                ArtifactFactory.createWireService(), null);
        scope.register(context);
        Operation<Type> operation = new Operation<Type>("greet", null, null, null, false, null);
        TargetInvoker invoker = context.createTargetInvoker(null, operation);
        assertEquals("foo", invoker.invokeTarget(new String[]{"foo"}));
        scope.stop();
    }
View Full Code Here

        List<Class<?>> services = new ArrayList<Class<?>>();
        services.add(Greeting.class);
        JavaScriptComponent context =
            new JavaScriptComponent("source", implClass2, new HashMap<String, Object>(), services, null, scope,
                ArtifactFactory.createWireService(), null);
        scope.register(context);

        InboundWire wire = ArtifactFactory.createInboundWire("Greeting", Greeting.class);
        ArtifactFactory.terminateWire(wire);
        for (InboundInvocationChain chain : wire.getInvocationChains().values()) {
            chain.setTargetInvoker(context.createTargetInvoker(null, chain.getOperation()));
View Full Code Here

    public void testScopedInvoke() throws Exception {
        ScopeContainer scope = new ModuleScopeContainer(null);
        scope.start();
        JavaAtomicComponent component =
            MockFactory.createJavaComponent("foo", scope, Echo.class);
        scope.register(component);
        JavaTargetInvoker invoker = new JavaTargetInvoker(echoMethod, component);
        invoker.setCacheable(false);
        assertEquals("foo", invoker.invokeTarget("foo"));
        scope.stop();
    }
View Full Code Here

    public void testClone() throws Exception {
        ScopeContainer scope = new ModuleScopeContainer(null);
        scope.start();
        JavaAtomicComponent component =
            MockFactory.createJavaComponent("foo", scope, Echo.class);
        scope.register(component);
        JavaTargetInvoker invoker = new JavaTargetInvoker(echoMethod, component);
        invoker.setCacheable(false);
        JavaTargetInvoker clone = invoker.clone();
        assertEquals("foo", clone.invokeTarget("foo"));
        scope.stop();
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.