java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.search.processing.JobManager
org.aspectj.org.eclipse.jdt.internal.core.search.indexing.IndexManager
Alle implementierten Schnittstellen:
IIndexConstants

public class IndexManager extends JobManager implements IIndexConstants
  • Felddetails

    • indexLocations

      public SimpleLookupTable indexLocations
      synchronized by IndexManager.this
      key = containerPath, value = indexLocation path
      indexLocation path is created by appending an index file name to the getJavaPluginWorkingLocation() path
    • SAVED_STATE

      public static final Integer SAVED_STATE
    • UPDATING_STATE

      public static final Integer UPDATING_STATE
    • UNKNOWN_STATE

      public static final Integer UNKNOWN_STATE
    • REBUILDING_STATE

      public static final Integer REBUILDING_STATE
    • REUSE_STATE

      public static final Integer REUSE_STATE
    • MANAGE_PRODUCT_INDEXES_PROPERTY

      public static final String MANAGE_PRODUCT_INDEXES_PROPERTY
      Siehe auch:
    • INDEX_MANAGER_NOTIFY_IDLE_WAIT_PROPERTY

      public static final String INDEX_MANAGER_NOTIFY_IDLE_WAIT_PROPERTY
      Siehe auch:
    • DEBUG

      public static boolean DEBUG
  • Konstruktordetails

    • IndexManager

      public IndexManager()
  • Methodendetails

    • waitForIndex

      public org.eclipse.core.runtime.IStatus waitForIndex(boolean enableIndexer, org.eclipse.core.runtime.IProgressMonitor monitor)
      Waits until all indexing jobs are done or given monitor is cancelled.
      Parameter:
      enableIndexer - true if this method should temporarily enable index manager and disable it again at the end (if the index manager was disabled before calling this method). If false is given and index manager is disabled, this method will block until index manager will be enabled again.
      monitor - for cancellation
      Gibt zurück:
      Status#CANCEL_STATUS if the waiting was cancelled, Status#OK_STATUS otherwise
    • aboutToUpdateIndex

      public void aboutToUpdateIndex(org.eclipse.core.runtime.IPath containerPath, Integer newIndexState)
    • addBinary

      public void addBinary(org.eclipse.core.resources.IFile resource, org.eclipse.core.runtime.IPath containerPath)
      Trigger addition of a resource to an index Note: the actual operation is performed in background
    • addSource

      public void addSource(org.eclipse.core.resources.IFile resource, org.eclipse.core.runtime.IPath containerPath, SourceElementParser parser)
      Trigger addition of a resource to an index Note: the actual operation is performed in background
    • cleanUpIndexes

      public void cleanUpIndexes()
      Removes unused indexes from disk.
    • computeIndexLocation

      public IndexLocation computeIndexLocation(org.eclipse.core.runtime.IPath containerPath, URL newIndexURL)
      Compute the pre-built index location for a specified URL
    • computeIndexLocation

      public IndexLocation computeIndexLocation(org.eclipse.core.runtime.IPath containerPath)
    • deleteIndexFiles

      public final void deleteIndexFiles()
    • deleteIndexFiles

      public void deleteIndexFiles(org.eclipse.core.runtime.IProgressMonitor monitor)
    • ensureIndexExists

      public void ensureIndexExists(IndexLocation indexLocation, org.eclipse.core.runtime.IPath containerPath)
    • getSourceElementParser

      public SourceElementParser getSourceElementParser(IJavaProject project, ISourceElementRequestor requestor)
    • getIndex

      public Index getIndex(IndexLocation indexLocation)
      Returns the index for a given index location
      Parameter:
      indexLocation - The path of the index file
      Gibt zurück:
      The corresponding index or null if not found
    • getIndex

      public Index getIndex(org.eclipse.core.runtime.IPath containerPath, boolean reuseExistingFile, boolean createIfMissing)
      Returns the index for a given project, according to the following algorithm: - if index is already in memory: answers this one back - if (reuseExistingFile) then read it and return this index and record it in memory - if (createIfMissing) then create a new empty index and record it in memory Warning: Does not check whether index is consistent (not being used)
    • getIndex

      public Index getIndex(org.eclipse.core.runtime.IPath containerPath, IndexLocation indexLocation, boolean reuseExistingFile, boolean createIfMissing)
      Returns the index for a given project, according to the following algorithm: - if index is already in memory: answers this one back - if (reuseExistingFile) then read it and return this index and record it in memory - if (createIfMissing) then create a new empty index and record it in memory Warning: Does not check whether index is consistent (not being used)
    • getIndexes

      public Index[] getIndexes(IndexLocation[] locations, org.eclipse.core.runtime.IProgressMonitor progressMonitor)
      Returns all the existing indexes for a list of index locations. Note that this may trigger some indexes recreation work
      Method is synchronized because it uses this.indexLocations and this.indexes
      Parameter:
      locations - The list of of the index files path
      Gibt zurück:
      The corresponding indexes list.
    • getIndexForUpdate

      public Index getIndexForUpdate(org.eclipse.core.runtime.IPath containerPath, boolean reuseExistingFile, boolean createIfMissing)
    • indexDocument

      public void indexDocument(SearchDocument searchDocument, SearchParticipant searchParticipant, Index index, org.eclipse.core.runtime.IPath indexLocation)
    • indexResolvedDocument

      public void indexResolvedDocument(SearchDocument searchDocument, SearchParticipant searchParticipant, Index index, org.eclipse.core.runtime.IPath indexLocation)
    • indexAll

      public void indexAll(org.eclipse.core.resources.IProject project)
      Trigger addition of the entire content of a project Note: the actual operation is performed in background
    • indexLibrary

      public void indexLibrary(org.eclipse.core.runtime.IPath path, org.eclipse.core.resources.IProject requestingProject, URL indexURL)
    • indexLibrary

      public void indexLibrary(org.eclipse.core.runtime.IPath path, org.eclipse.core.resources.IProject requestingProject, URL indexURL, boolean updateIndex)
      Trigger addition of a library to an index Note: the actual operation is performed in background
    • indexSourceFolder

      public void indexSourceFolder(JavaProject javaProject, org.eclipse.core.runtime.IPath sourceFolder, char[][] inclusionPatterns, char[][] exclusionPatterns)
      Index the content of the given source folder.
    • jobWasCancelled

      public void jobWasCancelled(org.eclipse.core.runtime.IPath containerPath)
    • moveToNextJob

      protected void moveToNextJob()
      Advance to the next available job, once the current one has been completed. Note: clients awaiting until the job count is zero are still waiting at this point.
      Setzt außer Kraft:
      moveToNextJob in Klasse JobManager
    • notifyIdle

      protected void notifyIdle(long idlingMilliSeconds)
      No more job awaiting.
      Angegeben von:
      notifyIdle in Klasse JobManager
    • processName

      public String processName()
      Name of the background process
      Angegeben von:
      processName in Klasse JobManager
    • recreateIndex

      public Index recreateIndex(org.eclipse.core.runtime.IPath containerPath)
      Recreates the index for a given path, keeping the same read-write monitor. Returns the new empty index or null if it didn't exist before. Warning: Does not check whether index is consistent (not being used)
    • remove

      public void remove(String containerRelativePath, org.eclipse.core.runtime.IPath indexedContainer)
      Trigger removal of a resource to an index Note: the actual operation is performed in background
    • removeIndex

      public void removeIndex(org.eclipse.core.runtime.IPath containerPath)
      Removes the index for a given path. This is a no-op if the index did not exist.
    • removeIndexPath

      public void removeIndexPath(org.eclipse.core.runtime.IPath path)
      Removes all indexes whose paths start with (or are equal to) the given path.
    • removeIndexFamily

      public void removeIndexFamily(org.eclipse.core.runtime.IPath path)
      Removes all indexes whose paths start with (or are equal to) the given path.
    • removeSourceFolderFromIndex

      public void removeSourceFolderFromIndex(JavaProject javaProject, org.eclipse.core.runtime.IPath sourceFolder, char[][] inclusionPatterns, char[][] exclusionPatterns)
      Remove the content of the given source folder from the index.
    • reset

      public void reset()
      Flush current state
      Setzt außer Kraft:
      reset in Klasse JobManager
    • resetIndex

      public boolean resetIndex(org.eclipse.core.runtime.IPath containerPath)
      Resets the index for a given path. Returns true if the index was reset, false otherwise.
    • savePreBuiltIndex

      public void savePreBuiltIndex(Index index) throws IOException
      saveIndex(Index) will only update the state if there are no other jobs running against the same underlying resource for this index. Pre-built indexes must be in a REUSE_STATE state even if there is another job to run against it as the subsequent job will find the index and not save it in the right state. Refer to https://bugs.eclipse.org/bugs/show_bug.cgi?id=405932
      Löst aus:
      IOException
    • saveIndex

      public void saveIndex(Index index) throws IOException
      Löst aus:
      IOException
    • saveIndexes

      public void saveIndexes()
      Commit all index memory changes to disk
    • scheduleDocumentIndexing

      public void scheduleDocumentIndexing(SearchDocument searchDocument, org.eclipse.core.runtime.IPath container, IndexLocation indexLocation, SearchParticipant searchParticipant)
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse JobManager
    • updateParticipant

      public void updateParticipant(org.eclipse.core.runtime.IPath indexPath, org.eclipse.core.runtime.IPath containerPath)
    • findMatchingIndexNames

      public Optional<Set<String>> findMatchingIndexNames(QualifierQuery query)
    • getMetaIndex

      public Optional<MetaIndex> getMetaIndex()