Package org.apache.tuscany.sca.implementation.java

Examples of org.apache.tuscany.sca.implementation.java.JavaImplementationFactory


        modelFactories.addFactory(policyFactory);
        ContributionFactory contributionFactory = modelFactories.getFactory(ContributionFactory.class);
        InterfaceContractMapper interfaceContractMapper = new InterfaceContractMapperImpl();
        JavaInterfaceFactory javaFactory = new DefaultJavaInterfaceFactory();
        modelFactories.addFactory(javaFactory);
        JavaImplementationFactory javaImplementationFactory = new BeanJavaImplementationFactory(beanFactory);
        modelFactories.addFactory(javaImplementationFactory);
       
        BaseJavaClassVisitor[] extensions = new BaseJavaClassVisitor[] {
            new ConstructorProcessor(assemblyFactory),
            new AllowsPassByReferenceProcessor(assemblyFactory),
            new ComponentNameProcessor(assemblyFactory),
            new ContextProcessor(assemblyFactory),
            new ConversationProcessor(assemblyFactory),
            new DestroyProcessor(assemblyFactory),
            new EagerInitProcessor(assemblyFactory),
            new InitProcessor(assemblyFactory),
            new PropertyProcessor(assemblyFactory),
            new ReferenceProcessor(assemblyFactory, javaFactory),
            new ResourceProcessor(assemblyFactory),
            new ScopeProcessor(assemblyFactory),
            new ServiceProcessor(assemblyFactory, javaFactory),
            new HeuristicPojoProcessor(assemblyFactory, javaFactory),
            new PolicyProcessor(assemblyFactory, policyFactory)
        };
        for (JavaClassVisitor e : extensions) {
            javaImplementationFactory.addClassVisitor(e);
        }

        // Populate ArtifactProcessor registry
        DefaultStAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(modelFactories);
        ExtensibleStAXArtifactProcessor staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance());
View Full Code Here


        inputFactory = XMLInputFactory.newInstance();
        staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(modelFactories);
        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance());
        intentAttachPointTypeFactory = new DefaultIntentAttachPointTypeFactory();
       
        JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
        modelFactories.addFactory(javaImplementationFactory);
       
        CompositeProcessor compositeProcessor = new CompositeProcessor(new ContributionFactoryImpl(), assemblyFactory, policyFactory, mapper, staxProcessor);
        staxProcessors.addArtifactProcessor(compositeProcessor);
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        processor = new ServiceProcessor(new DefaultAssemblyFactory(), new DefaultJavaInterfaceFactory());
        JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
        type = javaImplementationFactory.createJavaImplementation();
    }
View Full Code Here

        ProxyFactoryExtensionPoint proxyFactory = registry.getExtensionPoint(ProxyFactoryExtensionPoint.class);
        proxyFactory.setClassProxyFactory(new CglibProxyFactory(messageFactory, proxyFactory
            .getInterfaceContractMapper()));

        JavaInterfaceFactory javaFactory = factories.getFactory(JavaInterfaceFactory.class);
        JavaImplementationFactory javaImplementationFactory = factories.getFactory(JavaImplementationFactory.class);

        BaseJavaClassVisitor[] extensions =
            new BaseJavaClassVisitor[] {new ConstructorProcessor(assemblyFactory),
                                        new AllowsPassByReferenceProcessor(assemblyFactory),
                                        new ComponentNameProcessor(assemblyFactory),
                                        new ContextProcessor(assemblyFactory),
                                        new ConversationIDProcessor(assemblyFactory),
                                        new ConversationProcessor(assemblyFactory),
                                        new DestroyProcessor(assemblyFactory), new EagerInitProcessor(assemblyFactory),
                                        new InitProcessor(assemblyFactory), new PropertyProcessor(assemblyFactory),
                                        new ReferenceProcessor(assemblyFactory, javaFactory),
                                        new ResourceProcessor(assemblyFactory), new ScopeProcessor(assemblyFactory),
                                        new ServiceProcessor(assemblyFactory, javaFactory),
                                        new HeuristicPojoProcessor(assemblyFactory, javaFactory),
                                        new PolicyProcessor(assemblyFactory, policyFactory)};
        for (JavaClassVisitor extension : extensions) {
            javaImplementationFactory.addClassVisitor(extension);
        }

        DataBindingExtensionPoint dataBindings = registry.getExtensionPoint(DataBindingExtensionPoint.class);
        TransformerExtensionPoint transformers = registry.getExtensionPoint(TransformerExtensionPoint.class);
        MediatorImpl mediator = new MediatorImpl(dataBindings, transformers);
View Full Code Here

* @version $Rev: 567542 $ $Date: 2007-08-20 06:13:29 +0100 (Mon, 20 Aug 2007) $
*/
public class JavaClassIntrospectorImplTestCase extends TestCase {

    public void testRegister() throws Exception {
        JavaImplementationFactory factory = new DefaultJavaImplementationFactory();
        JavaClassVisitor extension = EasyMock.createNiceMock(JavaClassVisitor.class);
        factory.addClassVisitor(extension);
    }
View Full Code Here

        JavaClassVisitor extension = EasyMock.createNiceMock(JavaClassVisitor.class);
        factory.addClassVisitor(extension);
    }

    public void testUnegister() throws Exception {
        JavaImplementationFactory factory = new DefaultJavaImplementationFactory();
        JavaClassVisitor extension = EasyMock.createNiceMock(JavaClassVisitor.class);
        factory.addClassVisitor(extension);
        factory.removeClassVisitor(extension);
    }
View Full Code Here

        factory.removeClassVisitor(extension);
    }

    @SuppressWarnings("unchecked")
    public void testWalk() throws Exception {
        JavaImplementationFactory factory = new DefaultJavaImplementationFactory();
        JavaClassVisitor extension = EasyMock.createMock(JavaClassVisitor.class);
        extension.visitClass(EasyMock.eq(Bar.class), EasyMock.isA(JavaImplementation.class));
        extension.visitConstructor(EasyMock.isA(Constructor.class), EasyMock.isA(JavaImplementation.class));
        extension.visitMethod(EasyMock.isA(Method.class), EasyMock.isA(JavaImplementation.class));
        extension.visitField(EasyMock.isA(Field.class), EasyMock.isA(JavaImplementation.class));
        extension.visitSuperClass(EasyMock.isA(Class.class), EasyMock.isA(JavaImplementation.class));
        extension.visitEnd(EasyMock.isA(Class.class), EasyMock.isA(JavaImplementation.class));

        // mock.expects(once()).method("visitClass");
        // mock.expects(once()).method("visitMethod");
        // mock.expects(once()).method("visitField");
        // mock.expects(once()).method("visitConstructor");
        // mock.expects(once()).method("visitSuperClass");
        // mock.expects(once()).method("visitEnd");
        EasyMock.replay(extension);
        factory.addClassVisitor(extension);
        factory.createJavaImplementation(Bar.class);
        EasyMock.verify(extension);
    }
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        serviceProcessor = new ServiceProcessor(new DefaultAssemblyFactory(), new DefaultJavaInterfaceFactory());
        policyProcessor = new PolicyProcessor(new DefaultAssemblyFactory(), new DefaultPolicyFactory());
        JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
        type = javaImplementationFactory.createJavaImplementation();
    }
View Full Code Here

    }

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
        type = javaImplementationFactory.createJavaImplementation();
    }
View Full Code Here

    }

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
        type = javaImplementationFactory.createJavaImplementation();
        processor = new ReferenceProcessor(new DefaultAssemblyFactory(), new DefaultJavaInterfaceFactory());
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.implementation.java.JavaImplementationFactory

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.