J
James Robert Leek
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,
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,