Adding code to use AbortSetup to VClassGroupCache
This commit is contained in:
parent
70c0039372
commit
7ed25b3937
1 changed files with 14 additions and 9 deletions
|
@ -33,6 +33,7 @@ import edu.cornell.mannlib.vitro.webapp.dao.filtering.WebappDaoFactoryFiltering;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.filtering.filters.VitroFilterUtils;
|
import edu.cornell.mannlib.vitro.webapp.dao.filtering.filters.VitroFilterUtils;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.filtering.filters.VitroFilters;
|
import edu.cornell.mannlib.vitro.webapp.dao.filtering.filters.VitroFilters;
|
||||||
import edu.cornell.mannlib.vitro.webapp.flags.PortalFlag;
|
import edu.cornell.mannlib.vitro.webapp.flags.PortalFlag;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.servlet.setup.AbortStartup;
|
||||||
|
|
||||||
public class VClassGroupCache{
|
public class VClassGroupCache{
|
||||||
private static final Log log = LogFactory.getLog(VClassGroupCache.class);
|
private static final Log log = LogFactory.getLog(VClassGroupCache.class);
|
||||||
|
@ -63,6 +64,11 @@ public class VClassGroupCache{
|
||||||
this._groupListMap = new ConcurrentHashMap<Integer, List<VClassGroup>>();
|
this._groupListMap = new ConcurrentHashMap<Integer, List<VClassGroup>>();
|
||||||
this._rebuildQueue = new ConcurrentLinkedQueue<String>();
|
this._rebuildQueue = new ConcurrentLinkedQueue<String>();
|
||||||
|
|
||||||
|
if( AbortStartup.isStartupAborted(context)){
|
||||||
|
_cacheRebuildThread = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
VClassGroupCacheChangeListener bccl = new VClassGroupCacheChangeListener(this);
|
VClassGroupCacheChangeListener bccl = new VClassGroupCacheChangeListener(this);
|
||||||
ModelContext.getJenaOntModel(context).register(bccl);
|
ModelContext.getJenaOntModel(context).register(bccl);
|
||||||
ModelContext.getBaseOntModel(context).register(bccl);
|
ModelContext.getBaseOntModel(context).register(bccl);
|
||||||
|
@ -255,16 +261,15 @@ public class VClassGroupCache{
|
||||||
}
|
}
|
||||||
|
|
||||||
private void requestStop() {
|
private void requestStop() {
|
||||||
log.info("Killing the thread.");
|
if( _cacheRebuildThread != null ){
|
||||||
_cacheRebuildThread.kill();
|
_cacheRebuildThread.kill();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
_cacheRebuildThread.join();
|
_cacheRebuildThread.join();
|
||||||
log.info("The thread is dead.");
|
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
log.warn("Waiting for the thread to die, but interrupted.", e);
|
log.warn("Waiting for the thread to die, but interrupted.", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected VClassGroupDao getVCGDao(){
|
protected VClassGroupDao getVCGDao(){
|
||||||
WebappDaoFactory wdf =(WebappDaoFactory)context.getAttribute("webappDaoFactory");
|
WebappDaoFactory wdf =(WebappDaoFactory)context.getAttribute("webappDaoFactory");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue