My proposal is to only keep the filenames stored as Strings and not the whole InputStream. So we do not have to mess with open filehandles etc...
Should I work on this till tomorrow? LieGrue, strub --- Gurkan Erdogdu <[email protected]> schrieb am Di, 14.4.2009: > Von: Gurkan Erdogdu <[email protected]> > Betreff: Re: WEBBEANS_XML_LOCATIONS keeps connection open > An: [email protected] > Datum: Dienstag, 14. April 2009, 19:26 > > Seems that this is a defect. Actually, it may be closed > after the stream is handled. It is used for parsing by the > > public static Element getRootElement(InputStream stream) > throws WebBeansException > > Maybe adding finally block to close the stream in this > method. > > Gurkan > > > > > ________________________________ > From: Mark Struberg <[email protected]> > To: [email protected] > Sent: Tuesday, April 14, 2009 5:43:31 PM > Subject: Re: WEBBEANS_XML_LOCATIONS keeps connection open > > > thank you guys! > > The question is: will the streams be used frequently in the > future and are they left open intentionally? > Or is this a code artifact which could/should be cleaned > up? > > I now checked in the refactoring described in OWB-89. > It would be cool if you can give it a quick ride since I'm > not 100% sure about my Eclipse reliance since I've updated > to the latest subclipse plugin. > > txs and LieGrue, > strub > > --- James Carman <[email protected]> > schrieb am Di, 14.4.2009: > > > Von: James Carman <[email protected]> > > Betreff: Re: WEBBEANS_XML_LOCATIONS keeps connection > open > > An: [email protected] > > Datum: Dienstag, 14. April 2009, 16:32 > > Do you have to parse it more than one > > time? > > > > On Tue, Apr 14, 2009 at 10:29 AM, Gurkan Erdogdu > > <[email protected]> > > wrote: > > > Hi; > > > > > > It will used by the XML parser to parse the > beans.xml > > files. > > > > > > Gurkan > > > > > > 2009/4/14 Mark Struberg <[email protected]> > > > > > >> > > >> Hi! > > >> > > >> Since WEBBEANS_XML_LOCATIONS in the > > MetaDataDiscoveryService is a > > >> > > >> > > WEBBEANS_XML_LOCATIONS.put(addPath.getFile(), > > addPath.openStream()); > > >> > > >> and URL#openStream() is basically equivalent > to > > >> openConnection().getInputStream() > > >> we have all the beans.xml opened all the > time. Is > > this really necessary? > > >> Can we somehow change the > WEBBEANS_XML_LOCATIONS > > to only keep the URI and > > >> not even the URL (may cause opening a > connection > > in some situations too)? > > >> > > >> txs and LieGrue, > > >> strub > > >> > > >> > > >> PS: I will rename the variable to camelCase > since > > it is no constant with my > > >> next checkin, so please wait for it - txs :) > > >> > > >> > > >> > > >> > > > > > > > > > -- > > > Gurkan Erdogdu > > > http://gurkanerdogdu.blogspot.com > > > > > > > >
