class KeySnapshotter implements Runnable {

    void dispose(boolean immediately) {
        if (thread != null) {
            rotatingWriter.setShutdownOnThreadInterrupted(immediately);
            thread.interrupt();
            try {
                thread.join();
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
            }
        } else {
            scheduledFuture.cancel(immediately);
        }
        tcStore = null;
    }

      KeySnapshotter(final Ehcache cache, final long interval,
                   final boolean doKeySnapshotOnDedicatedThread,
                   final RotatingSnapshotFile rotatingWriter);

}