You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Rajini Sivaram <ra...@googlemail.com> on 2007/10/30 10:13:02 UTC

Thread context classloader: Format of property file URI

Hello,

Can the URI used to specify the location of a property file containing the
value of a property be relative, or should it always be absolute? If it can
be relative, what is it relative to?

I couldn't find anything in the SCA Assembly Model Spec which gave the
format of the URI. All I could find was:

   -  file (optional) – a deferencable URI to a file containing a value
   for the property


The code which currently finds the file using this URI is


*org.apache.tuscany.sca.assembly.builder.impl.PropertyUtil.loadFromFile(String
file) {
    ...
         if (!uri.isAbsolute()) {
            //FIXME Should already be given an absolute file
            url = Thread.currentThread
().getContextClassLoader().getResource(file);
        } else {
            url = uri.toURL();
        }
    ...
}*

***
*
If it is possible to specify a relative URI, should it be resolved using the
contribution classloader using contribution import/export to read property
files from other contributions (similar to other artifacts)?


Thank you...

Regards,

Rajini

Re: Thread context classloader: Format of property file URI

Posted by Rajini Sivaram <ra...@googlemail.com>.
Thank you, Venkat. If there is no objection on the list, I will move
property file
resolution into the resolution phase for composites and use the model
resolver to obtain the URL for files specified using relative pathnames,
 using the contribution classloader.



Thank you...

Regards,

Rajini


On 10/30/07, Venkata Krishnan <fo...@gmail.com> wrote:
>
> Hi,
>
> I think the current assumption is that this file is a part of the
> contribution that contains the composite in question.  Hence it should be
> reasonable to use the contribution classloader to resolve this including
> the
> semantics that the import/export might bring in.   Lets hear what others
> think.
>
> Thanks
>
> - Venkat
>
>
> On 10/30/07, Rajini Sivaram < rajinisivaram@googlemail.com> wrote:
> >
> > Hello,
> >
> > Can the URI used to specify the location of a property file containing
> the
> > value of a property be relative, or should it always be absolute? If it
> > can
> > be relative, what is it relative to?
> >
> > I couldn't find anything in the SCA Assembly Model Spec which gave the
> > format of the URI. All I could find was:
> >
> >    -  file (optional) – a deferencable URI to a file containing a value
> >    for the property
> >
> >
> > The code which currently finds the file using this URI is
> >
> >
> > *org.apache.tuscany.sca.assembly.builder.impl.PropertyUtil.loadFromFile
> > (String
> > file) {
> >     ...
> >          if (!uri.isAbsolute()) {
> >             //FIXME Should already be given an absolute file
> >             url = Thread.currentThread
> > ().getContextClassLoader().getResource(file);
> >         } else {
> >             url = uri.toURL();
> >         }
> >     ...
> > }*
> >
> > ***
> > *
> > If it is possible to specify a relative URI, should it be resolved using
> > the
> > contribution classloader using contribution import/export to read
> property
> > files from other contributions (similar to other artifacts)?
> >
> >
> > Thank you...
> >
> > Regards,
> >
> > Rajini
> >
>

Re: Thread context classloader: Format of property file URI

Posted by Venkata Krishnan <fo...@gmail.com>.
Hi,

I think the current assumption is that this file is a part of the
contribution that contains the composite in question.  Hence it should be
reasonable to use the contribution classloader to resolve this including the
semantics that the import/export might bring in.   Lets hear what others
think.

Thanks

- Venkat


On 10/30/07, Rajini Sivaram <ra...@googlemail.com> wrote:
>
> Hello,
>
> Can the URI used to specify the location of a property file containing the
> value of a property be relative, or should it always be absolute? If it
> can
> be relative, what is it relative to?
>
> I couldn't find anything in the SCA Assembly Model Spec which gave the
> format of the URI. All I could find was:
>
>    -  file (optional) – a deferencable URI to a file containing a value
>    for the property
>
>
> The code which currently finds the file using this URI is
>
>
> *org.apache.tuscany.sca.assembly.builder.impl.PropertyUtil.loadFromFile
> (String
> file) {
>     ...
>          if (!uri.isAbsolute()) {
>             //FIXME Should already be given an absolute file
>             url = Thread.currentThread
> ().getContextClassLoader().getResource(file);
>         } else {
>             url = uri.toURL();
>         }
>     ...
> }*
>
> ***
> *
> If it is possible to specify a relative URI, should it be resolved using
> the
> contribution classloader using contribution import/export to read property
> files from other contributions (similar to other artifacts)?
>
>
> Thank you...
>
> Regards,
>
> Rajini
>