A change to a file.
Listens for changes to files in a
A scope in which files are monitored.
Filters the files in a
Listens for removal of
Base class for file scope implementations.
A key used to look up cached information about a content set.
A single root directory in a
File scope that includes the files in a project
A collection of changes to files.
A set of files selected from a single root directory.
Provides common implementations of
Abstract base class for file table implementations based on
Persistently stores information about a set of files, and provides a mapping from each file to an integer ID.
The source and class paths of a library.
An ordered path made up of
Caches project properties.
The type of change.
Thrown when file change data has expired.
Thrown if the file table data is determined to be invalid.
There are two ways to receive notification about file changes:
With on-demand listening, the listener is instead called only when the client needs to be updated. At that point, it can synchronously obtain all changes since a previous point in time. For example, a cache might contain cached data which is invalid once a file changes. When a client calls into the cache, it can query the file change API to obtain all the file changes since the last time the cache was updated. This will include all changes up to the point where the call is made. This mechanism ensures that the cache is always up to date with the latest changes. It also avoids performance problems. Rather than updating the cache immediately every time a file changes, the cache is updated only when a client uses it. This avoids wasting time continuously updating caches that no one is using.
A typical pattern for using on-demand listening to invalidate a cache is as follows:
getFileTablesto get the file tables for the scope you are interested in. Do not cache this list of tables, as it can change. Call this each time to get the current list.
getChangesSince. If you've never seen this file table before, use
FIRST_VERSIONfor the version and -1L for the cookie. Otherwise, pass in the version and cookie from the last time.