hank1
asked on
runFinalizersOnExit
Is there anyway to hardwire runFinalizersOnExit
into a class?
Can you make an object that absolutely will run its
its finalize method? If you can't insure it how do
you note it in the javadoc page. Is there a standard
BEWARE gif I haven't seen? Is there a compiler way to
change the default of not running finalizers. (Does
java have a "pragma" way of controlling the compiler?)
Oh, just questions questions questions.
Comments only for a few days unless your believe your
answer is truly a definitive.
into a class?
Can you make an object that absolutely will run its
its finalize method? If you can't insure it how do
you note it in the javadoc page. Is there a standard
BEWARE gif I haven't seen? Is there a compiler way to
change the default of not running finalizers. (Does
java have a "pragma" way of controlling the compiler?)
Oh, just questions questions questions.
Comments only for a few days unless your believe your
answer is truly a definitive.
ASKER
Running a program normally allows runFinalizersOnExit(true)
to run the finalize methods. 'break'ing out of a program
defeats it. Anyway to 'capture' this
abnormal program abort and let runFinalizersOnExit()
do it thing?
to run the finalize methods. 'break'ing out of a program
defeats it. Anyway to 'capture' this
abnormal program abort and let runFinalizersOnExit()
do it thing?
Not to the best of my knowledge,
If it is really important to do this clean up you will have to do
the house keeping yourself.
If you are talking about breaking out if a program by an execption you can catch this using
try
{
..program
}
catch(Throwable t)
{
cleanUp();
}
}
If it is really important to do this clean up you will have to do
the house keeping yourself.
If you are talking about breaking out if a program by an execption you can catch this using
try
{
..program
}
catch(Throwable t)
{
cleanUp();
}
}
ASKER
Ah yes, so right. Just capture the exception ... Dahhhh
Thanks. Plop an answer in here and I'll give rjg2000 the points
PS - You ready for 1999 - 2000 xsistion ( which is still the
20th century by-the-way)
Thanks. Plop an answer in here and I'll give rjg2000 the points
PS - You ready for 1999 - 2000 xsistion ( which is still the
20th century by-the-way)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
not as such, you can call Runtime.runFinalizersOnExi
The way I would approach this is if the finalizer is so important then I would explictly call your own finaliztion method when you throw the object away. (you imply that you really need the locked resource back and this thus guarantees it).