diff options
author | Brian S. O'Neill <bronee@gmail.com> | 2009-12-22 01:15:07 +0000 |
---|---|---|
committer | Brian S. O'Neill <bronee@gmail.com> | 2009-12-22 01:15:07 +0000 |
commit | 4684549782accd0ffba1aefd15d42918effeddfd (patch) | |
tree | e4b44a9c85b8f4a2be60f94268c7f92d55cdf337 /src/main/java/com/amazon/carbonado/repo | |
parent | ca6d4484142d8144f7567a37ed448babe294fda8 (diff) |
Added isClosed method to Repository.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/repo')
3 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/com/amazon/carbonado/repo/indexed/IndexedRepository.java b/src/main/java/com/amazon/carbonado/repo/indexed/IndexedRepository.java index 44cc5d1..de6b8df 100644 --- a/src/main/java/com/amazon/carbonado/repo/indexed/IndexedRepository.java +++ b/src/main/java/com/amazon/carbonado/repo/indexed/IndexedRepository.java @@ -227,6 +227,10 @@ class IndexedRepository implements Repository, mRepository.close();
}
+ public boolean isClosed() {
+ return mRepository.isClosed();
+ }
+
public Repository getRootRepository() {
return mRootRef.get();
}
diff --git a/src/main/java/com/amazon/carbonado/repo/logging/LoggingRepository.java b/src/main/java/com/amazon/carbonado/repo/logging/LoggingRepository.java index 3c47857..a3d1d4b 100644 --- a/src/main/java/com/amazon/carbonado/repo/logging/LoggingRepository.java +++ b/src/main/java/com/amazon/carbonado/repo/logging/LoggingRepository.java @@ -106,6 +106,10 @@ class LoggingRepository implements Repository, LogAccessCapability { public void close() {
mRepo.close();
}
+
+ public boolean isClosed() {
+ return mRepo.isClosed();
+ }
public Log getLog() {
return mLog;
diff --git a/src/main/java/com/amazon/carbonado/repo/replicated/ReplicatedRepository.java b/src/main/java/com/amazon/carbonado/repo/replicated/ReplicatedRepository.java index d3414af..e4fdd4c 100644 --- a/src/main/java/com/amazon/carbonado/repo/replicated/ReplicatedRepository.java +++ b/src/main/java/com/amazon/carbonado/repo/replicated/ReplicatedRepository.java @@ -266,6 +266,10 @@ class ReplicatedRepository mMasterRepository.close();
}
+ public boolean isClosed() {
+ return mReplicaRepository.isClosed() || mMasterRepository.isClosed();
+ }
+
public String[] getUserStorableTypeNames() throws RepositoryException {
StorableInfoCapability replicaCap =
mReplicaRepository.getCapability(StorableInfoCapability.class);
|