On Thu, Jun 18, 2009 at 3:41 PM, Raymond Feng<[email protected]> wrote:
> 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
>

I think what Raymond is trying to say is that, if we use 2), then
existent SCA mechanisms could easily accomplish what you want, you
could use resource import/export in sca-contribution.xml file to
easily allow you to import spring contexts from other contributions.
If you are looking to support this in 2.x, then we might need to check
if contribution-resource is already ported to that code stream.

> 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
>



-- 
Luciano Resende
Apache Tuscany, Apache PhotArk
http://people.apache.org/~lresende
http://lresende.blogspot.com/

Reply via email to