Adding synchronous build of VClassGroupCache at startup. NIHVIVO-2763
This commit is contained in:
parent
68b9c1d9b5
commit
62ed1ab96d
1 changed files with 11 additions and 6 deletions
|
@ -77,7 +77,6 @@ public class VClassGroupCache {
|
||||||
_cacheRebuildThread = new RebuildGroupCacheThread(this);
|
_cacheRebuildThread = new RebuildGroupCacheThread(this);
|
||||||
_cacheRebuildThread.setDaemon(true);
|
_cacheRebuildThread.setDaemon(true);
|
||||||
_cacheRebuildThread.start();
|
_cacheRebuildThread.start();
|
||||||
_cacheRebuildThread.informOfQueueChange();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized VClassGroup getGroup(String vClassGroupURI) {
|
public synchronized VClassGroup getGroup(String vClassGroupURI) {
|
||||||
|
@ -122,6 +121,7 @@ public class VClassGroupCache {
|
||||||
log.debug("requesting update");
|
log.debug("requesting update");
|
||||||
_cacheRebuildThread.informOfQueueChange();
|
_cacheRebuildThread.informOfQueueChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void requestStop() {
|
protected void requestStop() {
|
||||||
if (_cacheRebuildThread != null) {
|
if (_cacheRebuildThread != null) {
|
||||||
_cacheRebuildThread.kill();
|
_cacheRebuildThread.kill();
|
||||||
|
@ -142,6 +142,9 @@ public class VClassGroupCache {
|
||||||
return wdf.getVClassGroupDao();
|
return wdf.getVClassGroupDao();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void doSynchronousRebuild(){
|
||||||
|
_cacheRebuildThread.rebuildCache(this);
|
||||||
|
}
|
||||||
|
|
||||||
/* **************** static utility methods ***************** */
|
/* **************** static utility methods ***************** */
|
||||||
|
|
||||||
|
@ -334,8 +337,10 @@ public class VClassGroupCache {
|
||||||
@Override
|
@Override
|
||||||
public void contextInitialized(ServletContextEvent sce) {
|
public void contextInitialized(ServletContextEvent sce) {
|
||||||
ServletContext servletContext = sce.getServletContext();
|
ServletContext servletContext = sce.getServletContext();
|
||||||
servletContext.setAttribute(ATTRIBUTE_NAME, new VClassGroupCache(
|
VClassGroupCache vcgc = new VClassGroupCache(servletContext);
|
||||||
servletContext));
|
servletContext.setAttribute(ATTRIBUTE_NAME,vcgc);
|
||||||
|
vcgc.doSynchronousRebuild();
|
||||||
|
log.info("VClassGroupCache added to context");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue