A few thoughts:
- You need the URI of an artifact inside the SCA contribution.
- I indicated before that I needed input/outputStreams as well.
- I think it's useful to have the URL of the contribution to have a base
URL to load artifacts (for example for WSDLs and XSDs if they do <import
... location="/aFile.xsd or /aFile.wsdl">).
So I suggest read/write(URL contributionURL, String artifactURI,
Input/OutputStream input/outputStream). In most cases you just use the
input/outputStream, sometimes you need to know the contributionURL, and
if you want to know the artifact URL you do new URL(contributionURL,
artifactURI).
I have committed under revision 533250 the base contribution URL and the
artifact URI to the read method.
I still have some concerns with the inputStream as today, inputStreams are
created only if there is a particular processor for the artifactType and if
the artifactProcessor needs to perform something with the artifact, by
moving the creation of the stream to the contribution service level, a
stream will need to be created for every artifact even if there is no
artifactProcesor to handle the file.
I'll investigate possible refactoring to make this more situable .
On 4/27/07, Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote:
Luciano Resende wrote:
>
>> >> I was thinking that Class loading would be the responsibility of the
>> >> ArtifactResolver. So, we wouldn't need a ClassLoader, we would call
>> >> ArtifactResolver.resolve() to get the Class, like for all other
>> >> artifacts resolved in an SCA contribution.
>> >
I have committed a change to allow ArtifactResolver to be used to
resolve classes.
Here's how to use it to get a foo.Bar class:
ClassReference ref = new ClassReference("foo.Bar");
ClassReference resolved = resolver.resolve(ref);
Class clazz = resolved.getJavaClass ();
The DefaultArtifactResolver constructor now takes a ClassLoader.
DefaultArtifactResolver and ClassReference use WeakReferences to
ClassLoader and Class to avoid memory leaks.
--
Jean-Sebastien
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Luciano Resende
http://people.apache.org/~lresende <http://people.apache.org/%7Elresende>