Package org.apache.tuscany.spi.implementation.java

Examples of org.apache.tuscany.spi.implementation.java.PojoComponentType


    public void load(CompositeComponent parent, SystemImplementation implementation,
                     DeploymentContext deploymentContext) throws LoaderException {
        Class<?> implClass = implementation.getImplementationClass();
        URL sidefile = implClass.getResource(JavaIntrospectionHelper.getBaseName(implClass) + ".componentType");
        PojoComponentType componentType;
        if (sidefile == null) {
            componentType = loadByIntrospection(parent, implementation, deploymentContext);
        } else {
            componentType = loadFromSidefile(sidefile, deploymentContext);
        }
View Full Code Here


    public void load(CompositeComponent parent,
                     JavaImplementation implementation,
                     DeploymentContext deploymentContext) throws LoaderException {
        Class<?> implClass = implementation.getImplementationClass();
        URL resource = implClass.getResource(JavaIntrospectionHelper.getBaseName(implClass) + ".componentType");
        PojoComponentType componentType;
        if (resource == null) {
            componentType = loadByIntrospection(parent, implementation, deploymentContext);
        } else {
            componentType = loadFromSidefile(resource, deploymentContext);
        }
View Full Code Here

     * Creates a component named "source" with a reference to target/Target
     */
    public static ComponentDefinition<SystemImplementation> createSourceWithTargetReference()
        throws NoSuchMethodException {
        SystemImplementation impl = new SystemImplementation();
        PojoComponentType componentType = new PojoComponentType();
        componentType.setImplementationScope(Scope.MODULE);
        componentType
            .setConstructorDefinition(
                new ConstructorDefinition<SourceImpl>(SourceImpl.class.getConstructor((Class[]) null)));
        JavaMappedReference reference;
        try {
            reference = new JavaMappedReference();
            reference.setName("target");
            reference.setMember(SourceImpl.class.getMethod("setTarget", Target.class));
            JavaServiceContract contract = new JavaServiceContract();
            contract.setInterfaceClass(Target.class);
            reference.setServiceContract(contract);
            componentType.add(reference);
        } catch (NoSuchMethodException e) {
            throw new AssertionError(e);
        }
        impl.setComponentType(componentType);
        impl.setImplementationClass(SourceImpl.class);
View Full Code Here

    /**
     * Creates a component named "source" with an autowire reference to {@link Target}
     */
    public static ComponentDefinition<SystemImplementation> createSourceWithTargetAutowire() {
        SystemImplementation impl = new SystemImplementation();
        PojoComponentType componentType = new PojoComponentType();
        componentType.setImplementationScope(Scope.MODULE);
        JavaMappedReference reference;
        try {
            reference = new JavaMappedReference();
            reference.setName("target");
            reference.setMember(SourceImpl.class.getMethod("setTarget", Target.class));
            reference.setAutowire(true);
            ServiceContract<?> contract = new JavaServiceContract();
            contract.setInterfaceClass(Target.class);
            reference.setServiceContract(contract);
            componentType.add(reference);
        } catch (NoSuchMethodException e) {
            throw new AssertionError(e);
        }
        impl.setComponentType(componentType);
        impl.setImplementationClass(SourceImpl.class);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.spi.implementation.java.PojoComponentType

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.