avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <cziege...@s-und-n.de>
Subject RE: Usage ? on Source and SourceResolver
Date Wed, 06 Feb 2002 07:29:50 GMT

> Michael McKibben wrote:
> Quick question on the usage of the SourceResolver and Source interfaces:
> I am writing an implementation of the TRAX URIResolver interface which
> delegates to the SourceResolver component. It seems pretty staightforward
> to call Source.getInputStream() and wrap that with a TRAX
> StreamSource. The question is, is it safe now to call
> SourceResolver.release(source), or must I stash this away and discard
> later? I am worried that calling release would close the underlying stream
> that I just returned in the wrapped StreamSource. Both the Resource and
> URL source implementation don't appear to implement Disposable/Recyclable,
> but I'm worried I'm relying on an assumption which may not hold for all
> Source implementations.
> So is it safe so say that after I call getInputStream() on any Source
> impl, I am now the owner of the InputStream and calling release() on the
> SourceResolver will not invalidate this stream (how rude!)?
Yes, you are the owner then - you can release the source object and use
the input stream later on.

> Thanks in advance, and sorry for all the nagging questions lately. It just
> seems that I keep finding ways to use Avalon more and more these days!
> Regards,
> --mike
> --
> To unsubscribe, e-mail:
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>

To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>

View raw message