+ public void release() {
+ try {
+ // TODO: verify that channel.close should be called after release() for rigourous locking.
+ if (lock!=null && lock.isValid())
+ lock.release();
+ if (rafile!=null && rafile.getChannel().isOpen())
+ rafile.getChannel().close();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace(System.err);
+ }
+ lock=null;
+ rafile=null;
+ }
+