There are two separate things.

1) Spring provides two subclasses of AbstractXmlApplicationContext [1] to handle the file-based locations and classpath-based locations. 2) Tuscany implementation.spring uses locations either as absolute URLs or relative to contributions

IMO, we should subclass AbstractXmlApplicationContext and provide a ResourcePatternResolver [2] to create UrlResource [3] to support our location schemes.

[1] http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/context/support/AbstractXmlApplicationContext.html [2] http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/core/io/support/ResourcePatternResolver.html [3] http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/core/io/UrlResource.html

Thanks,
Raymond

From: Ramkumar R
Sent: Thursday, June 18, 2009 3:40 AM
To: [email protected]
Subject: [DISCUSS] Supporting files outside the contribution for implementation.spring


Implementation Spring supports handling of multiple application contexts using ClassPathXmlApplicationContext
and FileSystemXmlApplicationContext.

ClassPathXmlApplicationContext looks good as it accepts the path to files relative to the contribution, but there seems to be an issue while dealing with FileSystemXmlApplicationContext, as the relative path to the contribution is not accepted by spring (as per design), instead it expects a path relative to the current VM working directory.

To be specific, the path expected by spring runtime is shown below....

<bean id="beanRefFactory" class="org.springframework.context.support.FileSystemXmlApplicationContext">
      <constructor-arg>
         <list>
                  
<value>/src/main/resources/beanRef-SpringHelloWorld-context.xml</value>
                  
<value>/src/main/resources/bean-frontend-springimpl-context.xml</value>
         </list>
      </constructor-arg>
</bean>

In such cases, Tuscany classloaders are unable to see the files are they are out of the contribution and also
possibly out of the classloaders visibility.

Should we support any files outside the contribution OR can Tuscany support such usecases?

--
Thanks & Regards,
Ramkumar Ramalingam

Reply via email to