[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: VFS HDScanner test

mstruk do-not-reply at jboss.com
Wed Jun 25 12:11:42 EDT 2008


anonymous wrote : 
  | There should be a better api than having to set a system property to clear all unused locks. Can't this be incorporated into the VirtualFileHandler delete implementation?
  | 

Yes, we could add delete() method to VirtualFileHandler, and VirtualFile.

How should this method behave in the case of zip entries? It could be a no-op, or it could throw an exception ...

It's possible that someone causes locks outside of jbossas so even with this method a file delete is not guaranteed, we could return false in this case like File.delete() does.

Also, it's possible that the file we're trying to delete is in the middle of legitimate use. We can be 'bastards' and forcefully close the ZipFile and delete it. Or we can have a short grace period.
 

VirtualFileHandler:

  |    /**
  |     *  Delete a file represented by this handler
  |     *
  |     *  @param gracePeriod max time to wait for locks (in milliseconds)
  |     *  @return boolean true if file was deleted, false otherwise
  |     *  @throws IOException for any error
  |     */
  |    public boolean delete(int gracePeriod) throws IOException;
  | 



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4160591#4160591

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4160591



More information about the jboss-dev-forums mailing list