import java.lang.ref.*;

class JarJarToyCleanupManager extends ReferenceQueue {
	JarJarToyCleanupManager() {
		new Thread() {
			public void run() {
				JarJarToyCleanupInfo jjci;
				try {
					while (true) {
						jjci = (JarJarToyCleanupInfo) remove(0);
						jjci.doCleanup();
						jjci.clear();
					}
				} catch (InterruptedException ie) {
					System.out.println("Interrupted");
				}
			}
		}
		.start();
	}
}
