protected IndexFactory createIndexFactory(RAMDirectory directory) throws Exception {
IndexFactory targetIndexFactory = super.createIndexFactory(directory);
LockIndexFactory indexFactory = new LockIndexFactory();
indexFactory.setTargetIndexFactory(targetIndexFactory);
indexFactory.afterPropertiesSet();
return indexFactory;
}
}