JNI Invocation: static UN-initializers?

From: James Robert Leek (jrleek_at_soda.csua.berkeley.edu)
Date: 08/31/04


Date: Tue, 31 Aug 2004 16:21:39 +0000 (UTC)

I'm writing language interoperability tools for scientific computing. It
supports C, C++, Fortran, Python, and Java through the JNI. Anyway, my
boss would like to add static uninitializers. A static unitializer is the
opposite of a static initializer. Insted of being a static function that
is run when a class is statically loaded, a static uninitializer is run
once when the class is staticly unloaded. In general this means when the
JVM is unloaded, it should run some code for each class that has been
loaded.

So here's the question:

Is this even freakin' possible in Java? There are 2 ways I can think of
where it might work:

If the feature already exists in Java (As it does with C, and fortran)
such that when I call DestroyJavaVM, Java calls code. However, I
understand that DestroyJavaVM doesn't even work, so that might be a no go.

Another possibility would be if there is some way to have Java find all
the classes currently loaded and call some function on them, is that
possible?

Thanks,

-- 
Jim Leek
jrleek@soda.berkeley.edu


Relevant Pages

  • Re: Comments from those devleoping niche software.
    ... I've written Fortran 95 programs ... > but very user-friendly analysis packages. ... > best of my knowledge as a bridge engineer) don't exist in any other ... Java would provide the business logic and front end. ...
    (comp.programming)
  • myF2J
    ... I came across an ad for a product myF2J that converts Fortran 77 to ... readable Java (there is also the free f2j that I think is analogous to ... I'd rather program in Fortran ... as a "single object pattern" language. ...
    (comp.lang.fortran)
  • Re: Is Fortran more accurate than Java ?
    ... Fortran is far more portable ... >> than Java since it doesn't specify a detailed arithmetic model. ... Portability has a variety of shadings. ... There are still plenty of machines for which it is a problem but they ...
    (comp.lang.java.programmer)
  • Re: seeking advice for "translate" Fortran code to Java code
    ... redefine a common block as needed for each subroutine. ... Still, Java has no pointers, so I ... Java arrays are always what C would call arrays of pointers ... Fortran intrinsics in Java appropriately. ...
    (comp.lang.fortran)
  • Re: PL/I, COBOL, Advantages, Equivalence, et al
    ... But why Fortran and not Ada or Java? ... Java is simply not sufficiently powerful for number-crunching. ... The language requires so much ...
    (comp.lang.pl1)