Alongside the separation of loading and resolution there is a more
simplistic point here I think about the current implementation to do with
how a composite location is specified. As users of SCADomain I think Mike
and I fell into the trap of believing that
SCADomain.newInstance("my.composite")
would load and resolve my.composite. When actually it means that the runtime
will look for where my.composite is in the file system and load everything
there. Luciano has explained this in detail previously in this thread
(thanks Lucinao for taking the time to lay it out for us) and so is not a
suprise now.
In the case where contributions are coming from the file system how do you
specify a specific contribution root when you only have relative paths to
play with? For example, if I had
somedir
mydir1/
my.composite
mydir2/
myother.composite
Where somedir is added to the classpath. How do I configure the runtime to
load only the contribution starting at the mydir1 directory?
SCADomain.newInstance("my.composite") - won't find it as my.composite is not
directly on the classpath
SCASCADomain.newInstance("mydir1/my.composite") - will find it but deduces
that the root contribution dir is still somedir
SCASCADomain.newInstance("http://localhost",
"file:///c:/some/abolsute/path/somedir/mydir1/", "my.composite") - may find
it (haven't tried) but contains absolute path information
Should I be relying on jar packaging or completely independent folder
structures with no common root on the classpath? Or is there a sneaky way to
configure the location URL to make this work?
Sebatien's lazy loading work may make this problem go away in that only
referenced information will be loaded but it would be good to be able to be
explicit about the root of the contribution being loaded. For convenience
(when testing in maven) we could do two things
1/ detect that the composite name has relative path info in front of it
and leave this as part of the root path
and/or
2/ detect that relative paths have been provided in the location field and
combine with the contribution when trying to get the contribution resource.
I've created a page to document the behaviour of the embedded extension here
(http://cwiki.apache.org/confluence/display/TUSCANY/SCA+JAVA+host.embedded)
so we can describe the behaviour for users.
Simon