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

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


    public static Connector createConnector() {
        return new ConnectorImpl(createWireService(), null, null, null);
    }

    public static WireService createWireService() {
        return new JDKWireService(new WorkContextImpl(), null);
    }
View Full Code Here


        JavaAtomicComponent clientComponent =
            (JavaAtomicComponent) builder.build(parent, sourceDefinition, context);
        wireService.createWires(clientComponent, sourceDefinition);
        container.register(clientComponent);

        Connector connector = new ConnectorImpl(new JDKWireService(), null, scheduler , workContext);

        connector.connect(clientComponent);
        FooClient client = (FooClient) clientComponent.getServiceInstance();
        client.invoke();
        assertTrue(client.invoked);
View Full Code Here

        JavaAtomicComponent clientComponent2 =
            (JavaAtomicComponent) builder.build(parent, sourceDefinition2, context);
        wireService.createWires(clientComponent2, sourceDefinition2);
        container.register(clientComponent2);

        Connector connector = new ConnectorImpl(new JDKWireService(), null, scheduler, workContext);
        connector.connect(clientComponent1);
        connector.connect(clientComponent2);
        FooClient client1 = (FooClient) clientComponent1.getServiceInstance();
        client1.invoke();
        assertTrue(client1.invoked);
View Full Code Here

        void callback();
    }

    protected void setUp() throws Exception {
        super.setUp();
        wireService = new JDKWireService();
        container = new ModuleScopeContainer();
        container.start();
        context = createMock(DeploymentContext.class);
        context.getModuleScope();
        expectLastCall().andReturn(container).anyTimes();
        replay(context);

        scheduler = createMock(WorkScheduler.class);
        scheduler.scheduleWork(isA(Runnable.class));
        expectLastCall().andStubAnswer(new IAnswer<Object>() {
            public Object answer() throws Throwable {
                Runnable runnable = (Runnable) getCurrentArguments()[0];
                runnable.run();
                return null;
            }
        });
        replay(scheduler);

        builder = new JavaComponentBuilder();
        workContext = new WorkContextImpl();
        builder.setWorkContext(workContext);
        builder.setWireService(new JDKWireService(workContext, null));
        builder.setWorkScheduler(scheduler);
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    public void testBuildConnect() throws Exception {
        CompositeComponent parent = new CompositeComponentImpl(null, null, null, null);

        CompositeBuilder builder = new CompositeBuilder();
        WireService wireService = new JDKWireService();
        builder.setWireService(wireService);
        BuilderRegistryImpl builderRegistry = new BuilderRegistryImpl();
        builderRegistry.setWireService(wireService);
        JavaComponentBuilder jBuilder = new JavaComponentBuilder();
        jBuilder.setWireService(wireService);
View Full Code Here

        sourceImpl.setImplementationClass(SourceImpl.class);
        ComponentDefinition<JavaImplementation> sourceComponentDefinition =
            new ComponentDefinition<JavaImplementation>(sourceImpl);

        JavaComponentBuilder builder = new JavaComponentBuilder();
        builder.setWireService(new JDKWireService());
        JavaAtomicComponent component =
            (JavaAtomicComponent) builder.build(parent, sourceComponentDefinition, deploymentContext);
        deploymentContext.getModuleScope().start();
        component.start();
        Source source = (Source) component.getServiceInstance();
View Full Code Here

        replay(scope);
        PojoConfiguration configuration = new PojoConfiguration();
        configuration.setScopeContainer(scope);
        configuration.setInstanceFactory(new PojoObjectFactory<TargetImpl>(TargetImpl.class.getConstructor()));
        configuration.addServiceInterface(Target.class);
        configuration.setWireService(new JDKWireService());
        final JavaAtomicComponent component = new JavaAtomicComponent("target", configuration, null);

        InboundWire wire = createMock(InboundWire.class);

        JavaServiceContract contract = new JavaServiceContract(Target.class);
View Full Code Here

TOP

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

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.