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

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


  return ""; //$NON-NLS-1$
}
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, this.requestor, this.participant, this.scope, progressMonitor);
    this.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


}


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);
  if (reuseExistingFile) this.separator = this.diskIndex.separator;
View Full Code Here

}


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

  this.memoryIndex = new MemoryIndex();
  this.diskIndex = new DiskIndex(location);
  this.diskIndex.initialize(reuseExistingFile);
  if (reuseExistingFile) this.separator = this.diskIndex.separator;
View Full Code Here

  return ""; //$NON-NLS-1$
}
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, this.requestor, this.participant, this.scope, progressMonitor);
    this.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.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.