public IndexingContext getContext() { IndexingContext result = context; while (result instanceof LockingIndexingContext) { result = ((LockingIndexingContext) result).getContext(); } return result; } }
@Override public int getSize() throws IOException { lock.lock(); try { return !isClosed() ? context.getSize() : 0; } finally { lock.unlock(); } }
groupContext = ((LockingIndexingContext) groupContext).getContext(); IndexingContext context = getRepositoryIndexContext(repository); if (context != null) { lockedContext = new LockingIndexingContext(context, lock);
contexts.put(repository.getId(), new LockingIndexingContext(context, lock));
@Override public IndexSearcher acquireIndexSearcher() throws IOException { lock.lock(); return !isClosed() ? context.acquireIndexSearcher() : EMPTY_SEARCHER; }
@Override public Set<String> getRootGroups() throws IOException { lock.lock(); try { return !isClosed() ? context.getRootGroups() : Collections.<String>emptySet(); } finally { lock.unlock(); } }
@Override public Set<String> getAllGroups() throws IOException { lock.lock(); try { return !isClosed() ? context.getAllGroups() : Collections.<String>emptySet(); } finally { lock.unlock(); } }
@Override public void releaseIndexSearcher(IndexSearcher s) throws IOException { try { if (!isClosed()) { context.releaseIndexSearcher(s); } } finally { lock.unlock(); } }