Hi Raymond and Luciano,

Looks like here the issue is not about supporting files that are part of
other contributions, but to
support the paths relative to the current VM working directory, which is a
deviation from the
current contribution model that we are following in SCA.

*NOTE:* In Spring, plain paths in FileSystemXmlApplicationContext will
always be interpreted as relative to the current VM working directory, even
if they start with a slash. (This is consistent with the semantics in a
Servlet container.) *Use an explicit "file:" prefix to enforce an absolute
file path.*

I believe, this will lead to some confusion within the user, whether they
should place the files
within the contribution OR keep them outside always.

So, I think it would be good if we can remove the support of loading
multiple application contexts with
FileSystemXmlApplicationContext in implementation.spring.

*NOTE:* We will still support loading of multiple application contexts with
ClassPathXmlApplicationContext,
and we will recommend the users to use ClassPathXmlApplicationContext for
all the multiple application context loading
feature with Tuscany.



On Fri, Jun 19, 2009 at 7:04 PM, Luciano Resende <[email protected]>wrote:

> 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://people.apache.org/%7Elresende>
> http://lresende.blogspot.com/
>



-- 
Thanks & Regards,
Ramkumar Ramalingam

Reply via email to