Search in sources :

Example 1 with IndexMerger

use of org.apache.archiva.indexer.merger.IndexMerger in project archiva by apache.

the class TemporaryGroupIndexSessionCleaner method sessionCreated.

@Override
public void sessionCreated(HttpSessionEvent httpSessionEvent) {
    // ensure the map is here to avoid NPE
    if (httpSessionEvent.getSession().getAttribute(TEMPORARY_INDEX_SESSION_KEY) == null) {
        httpSessionEvent.getSession().setAttribute(TEMPORARY_INDEX_SESSION_KEY, new HashMap<>());
    }
    if (indexMerger == null) {
        WebApplicationContext webApplicationContext = WebApplicationContextUtils.getRequiredWebApplicationContext(httpSessionEvent.getSession().getServletContext());
        indexMerger = webApplicationContext.getBean(IndexMerger.class);
    }
}
Also used : IndexMerger(org.apache.archiva.indexer.merger.IndexMerger) WebApplicationContext(org.springframework.web.context.WebApplicationContext)

Example 2 with IndexMerger

use of org.apache.archiva.indexer.merger.IndexMerger in project archiva by apache.

the class TemporaryGroupIndexSessionCleaner method getIndexMerger.

private IndexMerger getIndexMerger(HttpSessionEvent httpSessionEvent) {
    if (indexMerger == null) {
        WebApplicationContext webApplicationContext = WebApplicationContextUtils.getRequiredWebApplicationContext(httpSessionEvent.getSession().getServletContext());
        indexMerger = webApplicationContext.getBean(IndexMerger.class);
    }
    return indexMerger;
}
Also used : IndexMerger(org.apache.archiva.indexer.merger.IndexMerger) WebApplicationContext(org.springframework.web.context.WebApplicationContext)

Aggregations

IndexMerger (org.apache.archiva.indexer.merger.IndexMerger)2 WebApplicationContext (org.springframework.web.context.WebApplicationContext)2