public interface ISessionIndexProvider extends IIndexProvider
This interface extends the original index provider interface to facilitate disk index session level state caching. Provider objects will be called to initialize and dispose once per disk indexing session.
Example Usage:
class MyIndexProviderFactory implements IIndexProviderFactory { private MyIndexProvider default = null; public IIndexProvider createIndexProvider(IContentType contentType) { if (default == null) { default = new MyIndexProvider(); } return default; } } class MyIndexProvider extends AbstractIndexProvider implements ISessionIndexProvider { ... public void initSessionCache(IndexContext context) { // Initialize my caches here } public void disposeSessionCache() throws IndexException { // Clear my caches here } public void init(IndexContext context) { super.init(context); // Do any extra initialization required before creating the index // for a file, if any. } public void dispose() { super.dispose(); // Do any cleanup required after creating the index for a file, // if any. } }
ATT_LC_PREFIX, ATT_PREFIX, CONTAINER, ECLASS, IMPORTS, OBJ_RES_URI, OBJ_URI, REFC_PREFIX, REFNC_PREFIX, RES_URI
Modifier and Type | Method and Description |
---|---|
void |
disposeSessionCache()
Providers will be called to dispose at the end of the disk
indexing session.
|
void |
initSessionCache(IndexContext context)
This method will be called to initialize the provider only
once per disk indexing session, before the first call to
IIndexProvider.createIndexEntries(org.eclipse.emf.common.util.URI, IIndexWriter, org.eclipse.core.runtime.IProgressMonitor) |
createIndexEntries, dispose, init
void initSessionCache(IndexContext context) throws IndexException
IIndexProvider.createIndexEntries(org.eclipse.emf.common.util.URI, IIndexWriter, org.eclipse.core.runtime.IProgressMonitor)
IndexException
void disposeSessionCache() throws IndexException
IndexException