modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringImplementationWrapper.java [104:138]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public Object getBean(String name, Class<?> requiredType) {
        // The expectation is that the requested Bean is either a reference or a property
        // from the Spring context
        for (Reference reference : implementation.getReferences()) {
            if (reference.getName().equals(name)) {
                // Extract the Java interface for the reference (it can't be any other interface type
                // for a Spring application context)
                if (requiredType == null) {
                    JavaInterface javaInterface = (JavaInterface)reference.getInterfaceContract().getInterface();
                    requiredType = javaInterface.getJavaClass();
                }
                // Create and return the proxy for the reference
                return getService(requiredType, reference.getName());
            } // end if
        } // end for

        // For a property, get the name and the required Java type and create a Bean
        // of that type with the value inserted.
        for (Property property : implementation.getProperties()) {
            if (property.getName().equals(name)) {
                if (requiredType == null) {
                    // The following code only deals with a subset of types and was superceded
                    // by the information from the implementation (which uses Classes as found
                    // in the Spring implementation itself.
                    //requiredType = JavaXMLMapper.getJavaType( property.getXSDType() );
                    requiredType = implementation.getPropertyClass(name);
                }
                return getPropertyBean(requiredType, property.getName());
            } // end if
        } // end for
          // TODO: NoSuchBeanException
          // throw new RuntimeException("Unable to find Bean with name " + name);
        return null;

    } // end method getBean( String, Class )
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/SpringImplementationTie.java [104:138]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public Object getBean(String name, Class<?> requiredType) {
        // The expectation is that the requested Bean is either a reference or a property
        // from the Spring context
        for (Reference reference : implementation.getReferences()) {
            if (reference.getName().equals(name)) {
                // Extract the Java interface for the reference (it can't be any other interface type
                // for a Spring application context)
                if (requiredType == null) {
                    JavaInterface javaInterface = (JavaInterface)reference.getInterfaceContract().getInterface();
                    requiredType = javaInterface.getJavaClass();
                }
                // Create and return the proxy for the reference
                return getService(requiredType, reference.getName());
            } // end if
        } // end for

        // For a property, get the name and the required Java type and create a Bean
        // of that type with the value inserted.
        for (Property property : implementation.getProperties()) {
            if (property.getName().equals(name)) {
                if (requiredType == null) {
                    // The following code only deals with a subset of types and was superceded
                    // by the information from the implementation (which uses Classes as found
                    // in the Spring implementation itself.
                    //requiredType = JavaXMLMapper.getJavaType( property.getXSDType() );
                    requiredType = implementation.getPropertyClass(name);
                }
                return getPropertyBean(requiredType, property.getName());
            } // end if
        } // end for
          // TODO: NoSuchBeanException
        // throw new RuntimeException("Unable to find Bean with name " + name);
        return null;

    } // end method getBean( String, Class )
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



