Package org.aspectj.org.eclipse.jdt.internal.core.search.indexing

Examples of org.aspectj.org.eclipse.jdt.internal.core.search.indexing.ReadWriteMonitor


}


public Index(String fileName, String containerPath, boolean reuseExistingFile) throws IOException {
  this.containerPath = containerPath;
  this.monitor = new ReadWriteMonitor();

  this.memoryIndex = new MemoryIndex();
  this.diskIndex = new DiskIndex(fileName);
  this.diskIndex.initialize(reuseExistingFile);
}
View Full Code Here


public boolean search(Index index, IProgressMonitor progressMonitor) {
  if (index == null) return COMPLETE;
  if (progressMonitor != null && progressMonitor.isCanceled()) throw new OperationCanceledException();

  ReadWriteMonitor monitor = index.monitor;
  if (monitor == null) return COMPLETE; // index got deleted since acquired
  try {
    monitor.enterRead(); // ask permission to read
    long start = System.currentTimeMillis();
    MatchLocator.findIndexMatches(this.pattern, index, requestor, this.participant, this.scope, progressMonitor);
    executionTime += System.currentTimeMillis() - start;
    return COMPLETE;
  } catch (IOException e) {
    if (e instanceof java.io.EOFException)
      e.printStackTrace();
    return FAILED;
  } finally {
    monitor.exitRead(); // finished reading
  }
}
View Full Code Here

TOP

Related Classes of org.aspectj.org.eclipse.jdt.internal.core.search.indexing.ReadWriteMonitor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.