FYI - This was committed to vfs head today (not sure it helps?, but sounds like it would from Jeremy's description of the issue.)
> -----Original Message----- > From: Mario Ivankovits > Sent: Wednesday, July 07, 2004 4:20 PM > To: Jakarta Commons Developers List > Subject: Re: [VFS] FileSystem close > > > I try to take another approach to solve this problem. > > During adapting the test-cases to close() every single resolved file i > came to the conclusion it is nearly impossible to do this for a whole > system. > And if it comes to swap a system from java.io.File to VFS it is way too > hard to correctly place every FileObject.close(). > Sometimes VFS do itself resolv files and then it has to check the state > and maybe (or maybe not) close it after use. > I found it is a really complicated (and error-prone) thing. > > So i picked up the SoftRefFilesCache and adapted it slightly. > > The idea behind is - as long as a FileObject is "strongly reachable" by > the jvm there must be someone who is willing to access the file and thus > it is not allowed to close the filesystem. > As soon as the last file of a certain filesystem is garbage-collected > the filesystem can be (and will be) closed. > > For sure - now you do not have that control over this release process, > but it should work well. > > One has simply to ensure to release all references (assign null to it if > it is a global member) to make this work. > > @Johan: > I would like to remove the useCount (freeUnusedResources) stuff from vfs > again. Could you please try this in your environment. > > Instantiate your vfs manager like this: > > StandardFileSystemManager manager = new StandardFileSystemManager(); > manager.setFilesCache(new SoftRefFilesCache()); > manager.init(); > > and remove the call to freeUnusedResources - and - as long as you do not > use any input/output stream - the FileObject.close() is also no longer > needet. > > Thanks! > -- > Mario > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
