RFR: jmod remove

Chris Hegarty chris.hegarty at oracle.com
Mon Apr 30 14:22:47 PDT 2012


Thanks Jon and Paul, both very good suggestions.

Updated:
   http://cr.openjdk.java.net/~chegar/jigsaw/jmodrm.04/webrev/

>> How about throwing an exception containing a List<IOException>  for that case?

Right, I did flip flop on this before sending out the previous webrev. 
I've amended Library.remove to throw IOException and list additional 
exceptions as suppressed ( similar to URLClassloader.close ). It gives a 
clean API, but maybe you were thinking of defining a new Exception class?

> For the common case, at least with this implementation, the internal directory for the module can be moved to a trash directory [*], and if deletion then fails then it can be retried later when another operation on the library is performed (kind of like how weak hash map cleans up keys).

I implemented a .trash in the module library ( maybe this should be 
%trash? ). Modules to be removed firstly get atomically moved to .trash 
before being deleted. We can still directly call ModuleFile.remove since 
the modules content installed outside the module library (a.k.a "files") 
will still refer to the right relative locations since the directory 
depth in the module library is the same.

Thanks,
-Chris.

>
> Paul.
>
> [*] assuming move is an atomic operation
>
>> -- Jon



More information about the jigsaw-dev mailing list