Interface | Description |
---|---|
FileChange |
A change to a file.
|
FileChangeListener |
Listens for changes to files in a
FileScope . |
FileScope |
A scope in which files are monitored.
|
FileSetFilter |
Filters the files in a
FileSet . |
FileTableRemovedListener |
Listens for removal of
FileTable . |
FileTableVisitor |
Class | Description |
---|---|
AbstractFileScope |
Base class for file scope implementations.
|
ContentSetKey |
A key used to look up cached information about a content set.
|
ContentSetRoot |
A single root directory in a
ContentSet . |
ContentSetScope |
File scope that includes the files in a project
ContentSet . |
FileChanges |
A collection of changes to files.
|
FileSet |
A set of files selected from a single root directory.
|
FileSetFilters |
Provides common implementations of
FileSetFilter . |
FileSetTable |
Abstract base class for file table implementations based on
FileSet . |
FileTable |
Persistently stores information about a set of files, and provides a mapping
from each file to an integer ID.
|
LibraryPaths |
The source and class paths of a library.
|
Path |
An ordered path made up of
FileSet . |
ProjectCache |
Caches project properties.
|
ProjectCache.CacheEntry<E> |
Enum | Description |
---|---|
FileChange.Type |
The type of change.
|
FileTableVisitor.Result |
Exception | Description |
---|---|
FileChangesExpiredException |
Thrown when file change data has expired.
|
InvalidFileTableException |
Thrown if the file table data is determined to be invalid.
|
There are two ways to receive notification about file changes:
addFileChangeListener
method.getChangesSince
method.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:
getFileTables
to 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_VERSION
for the version and -1L for the cookie. Otherwise, pass in the version
and cookie from the last time.
FIRST_VERSION
and -1L.