summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon/carbonado/spi
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2009-12-22 01:15:07 +0000
committerBrian S. O'Neill <bronee@gmail.com>2009-12-22 01:15:07 +0000
commit4684549782accd0ffba1aefd15d42918effeddfd (patch)
treee4b44a9c85b8f4a2be60f94268c7f92d55cdf337 /src/main/java/com/amazon/carbonado/spi
parentca6d4484142d8144f7567a37ed448babe294fda8 (diff)
Added isClosed method to Repository.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/spi')
-rw-r--r--src/main/java/com/amazon/carbonado/spi/AbstractRepository.java6
-rw-r--r--src/main/java/com/amazon/carbonado/spi/BelatedRepositoryCreator.java4
2 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/com/amazon/carbonado/spi/AbstractRepository.java b/src/main/java/com/amazon/carbonado/spi/AbstractRepository.java
index 688134b..03a6b75 100644
--- a/src/main/java/com/amazon/carbonado/spi/AbstractRepository.java
+++ b/src/main/java/com/amazon/carbonado/spi/AbstractRepository.java
@@ -139,10 +139,16 @@ public abstract class AbstractRepository<Txn>
return null;
}
+ @Override
public void close() {
shutdown(false);
}
+ @Override
+ public boolean isClosed() {
+ return transactionManager().isClosed();
+ }
+
// Required by ShutdownCapability.
public synchronized boolean isAutoShutdownEnabled() {
return mShutdownHook != null;
diff --git a/src/main/java/com/amazon/carbonado/spi/BelatedRepositoryCreator.java b/src/main/java/com/amazon/carbonado/spi/BelatedRepositoryCreator.java
index b5676a4..6a7bad6 100644
--- a/src/main/java/com/amazon/carbonado/spi/BelatedRepositoryCreator.java
+++ b/src/main/java/com/amazon/carbonado/spi/BelatedRepositoryCreator.java
@@ -145,6 +145,10 @@ public class BelatedRepositoryCreator extends BelatedCreator<Repository, Support
public void close() {
}
+ public boolean isClosed() {
+ return false;
+ }
+
private IllegalStateException error() {
return new IllegalStateException
("Creation of Repository \"" + mBuilder.getName() + "\" is delayed");