@SuppressWarnings("unchecked")
		private void listen() throws InterruptedException {
			WatchKey watchKey = watcher.poll(5L, TimeUnit.SECONDS);
			if (stop || watchKey == null) {
				return;
			}
			for (WatchEvent<?> event : watchKey.pollEvents()) {
				if (stop || event.kind() == OVERFLOW) {
					continue;
				}
				File file = new File(cacheDir, ((WatchEvent<Path>)event).context().toFile().getName());
				if (event.kind() == ENTRY_CREATE) {
					if (file.getName().endsWith(WritePageFactory.PAGEFILE_POSTFIX)) {
						register(new ReadPage(file));
					} 
					continue;
				}
			}
			// reset the key
			boolean valid = watchKey.reset();
			if (!valid) {
				throw new CacheException("watch key became invalid");
			}
		}