Skip to content

claudemartin/java-cleanup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 

Repository files navigation

Defunct: use `Cleaner` instead!

This was just a little side project. Later I found out that there already is sun.misc.Cleaner and we should get java.util.Cleaner with Java 9. So use that instead. Maybe this can still be used if you want to learn how to use PhantomReferences, but don't use it in production.

Java's PhantomReferences made easy.

Do you know this situation: You have some java class and you need to cleanup after it was garbage collected? You tried finalize but it didn't work you you have read that finalize should not be used. The interface Cleanup allows you to register cleanup-code for any object. Implementing the interface Cleanup makes it even simpler.

An example is included and can be used like a tutorial: Example.java

Pros, Cons and Pitfalls can be found in the javadoc of Cleanup.

Note: this is just the readme. The project home is here: http://claude-martin.ch/java-cleanup/

About

Java's PhantomReferences made easy.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages