org.eclipse.jgit.lib.Repository instances.
| Modifier and Type | Class and Description |
|---|---|
| public static class | RepositoryCache.
Location of a Repository, using the standard java.io.File API. |
| public static interface | RepositoryCache.
Abstract hash key for |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final RepositoryCache | |
| private final Map | |
| private ScheduledFuture | |
| private volatile long | |
| private static final Logger | |
| private final RepositoryCache. | |
| private final Object |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static void | |
| private void | |
| private void | |
| pack-priv static void | |
| public static void | |
| private void | |
| private Collection | |
| public static Collection | Returns: the locations of all repositories registered in the cache.Get the locations of all repositories registered in the cache. |
| pack-priv static boolean | |
| private boolean | |
| private RepositoryCache. | |
| public static Repository | Returns: the repository instance requested; caller must close when done.where the local repository is. Typically a
locationorg..Open an existing repository, reusing a cached instance if possible. |
| public static Repository | Returns: the repository instance requested; caller must close when done.where the local repository is. Typically a
location,org..If true, and the repository is not found, throws mustExist)RepositoryNotFoundException. If false, a repository instance
is created and registered anyway.Open a repository, reusing a cached instance if possible. |
| private Repository | |
| pack-priv static void | |
| public static void | |
| private void | |
| public static void | |
| public static void | unregister(RepositoryCache.
location of the repository to remove. locationRemove a repository from the cache. |
| private void | |
| private Repository |
| cache | back to summary |
|---|---|
| private static final RepositoryCache cache | |
| cacheMap | back to summary |
|---|---|
| private final Map<RepositoryCache. | |
| cleanupTask | back to summary |
|---|---|
| private ScheduledFuture<?> cleanupTask | |
| expireAfter | back to summary |
|---|---|
| private volatile long expireAfter | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| openLocks | back to summary |
|---|---|
| private final RepositoryCache. | |
| schedulerLock | back to summary |
|---|---|
| private final Object schedulerLock | |
| RepositoryCache | back to summary |
|---|---|
| private RepositoryCache() | |
| clear | back to summary |
|---|---|
| public static void clear() Unregister all repositories from the cache. | |
| clearAll | back to summary |
|---|---|
| private void clearAll() | |
| clearAllExpired | back to summary |
|---|---|
| private void clearAllExpired() | |
| clearExpired | back to summary |
|---|---|
| pack-priv static void clearExpired() | |
| close | back to summary |
|---|---|
| public static void close(Repository db) Close and remove a repository from the cache. Removes a repository from the cache, if it is still registered here, and close it.
| |
| configureEviction | back to summary |
|---|---|
| private void configureEviction(RepositoryCacheConfig repositoryCacheConfig) | |
| getKeys | back to summary |
|---|---|
| private Collection | |
| getRegisteredKeys | back to summary |
|---|---|
| public static Collection Get the locations of all repositories registered in the cache.
| |
| isCached | back to summary |
|---|---|
| pack-priv static boolean isCached(Repository repo) | |
| isExpired | back to summary |
|---|---|
| private boolean isExpired(Repository db) | |
| lockFor | back to summary |
|---|---|
| private RepositoryCache. | |
| open | back to summary |
|---|---|
| public static Repository open(RepositoryCache. Open an existing repository, reusing a cached instance if possible.
When done with the repository, the caller must call
| |
| open | back to summary |
|---|---|
| public static Repository open(RepositoryCache. Open a repository, reusing a cached instance if possible.
When done with the repository, the caller must call
| |
| openRepository | back to summary |
|---|---|
| private Repository openRepository(final RepositoryCache. | |
| reconfigure | back to summary |
|---|---|
| pack-priv static void reconfigure(RepositoryCacheConfig repositoryCacheConfig) | |
| register | back to summary |
|---|---|
| public static void register(Repository db) Register one repository into the cache.
During registration the cache automatically increments the usage counter,
permitting it to retain the reference. A
If another repository already is registered in the cache at this location, the other instance is closed.
| |
| registerRepository | back to summary |
|---|---|
| private void registerRepository(RepositoryCache. | |
| unregister | back to summary |
|---|---|
| public static void unregister(Repository db) Remove a repository from the cache.
Removes a repository from the cache, if it is still registered here. This
method will not close the repository, only remove it from the cache. See
| |
| unregister | back to summary |
|---|---|
| public static void unregister(RepositoryCache. Remove a repository from the cache.
Removes a repository from the cache, if it is still registered here. This
method will not close the repository, only remove it from the cache. See
| |
| unregisterAndCloseRepository | back to summary |
|---|---|
| private void unregisterAndCloseRepository(RepositoryCache. | |
| unregisterRepository | back to summary |
|---|---|
| private Repository unregisterRepository(RepositoryCache. | |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| private static File | |
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. Indicates whether some other object is "equal to" this one. |
| public static RepositoryCache. | |
| public final File | Returns: directory containing the repository database.Get directory containing the repository database |
| public int | |
| public static boolean | Returns: true if the directory "looks like" a Git repository; false if it doesn't look enough like a Git directory to really be a Git directory.the location of the directory to examine. dir, FS the file system abstraction which will be necessary to
perform certain file system operations. fs)Guess if a directory contains a Git repository. |
| private static boolean | |
| public static RepositoryCache. | |
| public Repository | open(boolean
true if the repository must exist in order to be opened;
false if a new non-existent repository is permitted to be
created (the caller is responsible for calling create). mustExist)Implements org. Called by |
| private static String | |
| public static File | Returns: the actual directory location if a better match is found; null if there is no suitable match.location to guess from. Several permutations are tried. directory, FS the file system abstraction which will be necessary to
perform certain file system operations. fs)Guess the proper path for a Git repository. |
| public String |
| FileKey | back to summary |
|---|---|
| protected FileKey(File directory, FS fs) Create a pointer to a location on disk. | |
| canonical | back to summary |
|---|---|
| private static File canonical(File path) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| exact | back to summary |
|---|---|
| public static RepositoryCache. Obtain a pointer to an exact location on disk. No guessing is performed, the given location is exactly the GIT_DIR directory of the repository.
| |
| getFile | back to summary |
|---|---|
| public final File getFile() Get directory containing the repository database
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isGitRepository | back to summary |
|---|---|
| public static boolean isGitRepository(File dir, FS fs) Guess if a directory contains a Git repository. This method guesses by looking for the existence of some key files and directories.
| |
| isValidHead | back to summary |
|---|---|
| private static boolean isValidHead(File head) | |
| lenient | back to summary |
|---|---|
| public static RepositoryCache. Obtain a pointer to a location on disk. The method performs some basic guessing to locate the repository. Searched paths are:
| |
| open | back to summary |
|---|---|
| public Repository open(boolean mustExist) throws IOException Implements org. Doc from org. Called by If a repository does not exist yet in the cache, the cache will call this method to acquire a handle to it.
| |
| readFirstLine | back to summary |
|---|---|
| private static String readFirstLine(File head) | |
| resolve | back to summary |
|---|---|
| public static File resolve(File directory, FS fs) Guess the proper path for a Git repository. The method performs some basic guessing to locate the repository. Searched paths are:
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
RepositoryCache entries.
A Key instance should be lightweight, and implement hashCode() and equals() such that two Key instances are equal if they represent the same Repository location.
| Modifier and Type | Method and Description |
|---|---|
| public Repository | Returns: the new repository instance.true if the repository must exist in order to be opened;
false if a new non-existent repository is permitted to be
created (the caller is responsible for calling create). mustExist)Called by |
| open | back to summary |
|---|---|
| public Repository open(boolean mustExist) throws IOException, RepositoryNotFoundException Called by If a repository does not exist yet in the cache, the cache will call this method to acquire a handle to it.
| |
| Access | Constructor and Description |
|---|---|
| private |
| Lock | back to summary |
|---|---|
| private Lock() | |