An implementation of a cancel token, an object to conveniently reigster and invoke cleanup methods, in java.