Finalisation/cleanup of Java objects from SISC

Norman Gray <[email protected]> Wed, 22 Apr 2009 18:10:40 +0100
Newsgroups gmane.comp.java.sisc.user
Message-ID <[email protected]>
Greetings.

I'm working with Java objects which have associated open files  
(specifically, they're RDF models persisted using the Jena/TDB  
library).  These are (as usual) reclaimed by a call to the close()  
method on the associated Java object, but managing that requires the  
usual rather fiddly infrastructure, concerned with working out which  
part of the code is responsible for doing this cleanup.

I can't help feeling that the garbage collector ought to be helping me  
more, somehow -- we're writing Scheme here, not Java, dammit!  Am I  
missing something?

Having a finalize() method on the object, which calls close(), is one  
possibility, of course.  But such finalizers are generally deplored in  
Java style guides, broadly because the JVM GC makes no guarantees  
about when or if finalizers are called.

Is there anything in SISC which comes to the rescue here (I couldn't  
find anything in the manual)?  Any analogue of PLT's 'custodians'?  Or  
is there a Scheme idiom for home-made custodians I haven't heard about?

No...?

Oh well.

All the best,

Norman


-- 
Norman Gray  :  http://nxg.me.uk
Physics and Astronomy, University of Leicester


------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p