Package org.apache.tuscany.core.wire.jdk

Examples of org.apache.tuscany.core.wire.jdk.JDKTargetWireFactory


        FooWireBuilder fooBuilder = new FooWireBuilder();
        BarWireBuilder barBuilder = new BarWireBuilder();
        DefaultWireBuilder defaultBuilder = new DefaultWireBuilder();
        defaultBuilder.addWireBuilder(fooBuilder);
        defaultBuilder.addWireBuilder(barBuilder);
        TargetWireFactory targetFooFactory = new JDKTargetWireFactory();
        Map<Method, TargetInvocationConfiguration> fooConfigs = new HashMap<Method, TargetInvocationConfiguration>();
        TargetInvocationConfiguration fooInvocation = new TargetInvocationConfiguration(m);
        fooConfigs.put(m, fooInvocation);
        Map<Method, TargetInvocationConfiguration> barConfigs = new HashMap<Method, TargetInvocationConfiguration>();
        TargetInvocationConfiguration barInvocation = new TargetInvocationConfiguration(m);
        barConfigs.put(m, barInvocation);
        targetFooFactory.setConfiguration(new WireTargetConfiguration(null, fooConfigs, null, null));
        TargetWireFactory targetBarFactory = new JDKTargetWireFactory();
        targetBarFactory.setConfiguration(new WireTargetConfiguration(null, barConfigs, null, null));
        ScopeContext ctx = new MockScopeContext();
        defaultBuilder.completeTargetChain(targetFooFactory, FooContextFactory.class, ctx);
        defaultBuilder.completeTargetChain(targetBarFactory, BarContextFactory.class, ctx);
        assertEquals(FooInvoker.class, targetFooFactory.getConfiguration().getInvocationConfigurations().get(m).getTargetInvoker().getClass());
        assertEquals(BarInvoker.class, targetBarFactory.getConfiguration().getInvocationConfigurations().get(m).getTargetInvoker().getClass());

    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.core.wire.jdk.JDKTargetWireFactory

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.