DirectoryManager dirMgr = new DefaultDirectoryManager(dest, DIRECTORY_MODE.MMAP);
Zoie<R, D> zoie = new ZoieSystem(dirMgr, _interpreter, _decorator, _zoieConfig);
if (_running) zoie.start();
if (_zoieOne != null) {
final Zoie toBeShutdown = _zoieOne;
_zoieOne = zoie;
Timer cleanupTimer = new Timer();
cleanupTimer.schedule(new TimerTask() {
@Override
public void run() {
synchronized (_activeReaders) {
for (ZoieRef z : _activeReaders.values()) {
if (z.zoie == toBeShutdown) {
log.info("Waiting for active readers...");
return;
}
}
}
log.info("Shuting down old zoie...");
toBeShutdown.shutdown();
cancel();
}
}, 8000, 8000);
}