diff options
Diffstat (limited to 'src/main/java/com/amazon/carbonado/repo/logging')
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/logging/LoggingRepository.java | 7 | ||||
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/logging/LoggingRepositoryBuilder.java | 4 |
2 files changed, 7 insertions, 4 deletions
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 e44e3b7..3f17d17 100644 --- a/src/main/java/com/amazon/carbonado/repo/logging/LoggingRepository.java +++ b/src/main/java/com/amazon/carbonado/repo/logging/LoggingRepository.java @@ -21,9 +21,10 @@ package com.amazon.carbonado.repo.logging; import java.util.IdentityHashMap;
import java.util.Map;
+import java.util.concurrent.atomic.AtomicReference;
+
import com.amazon.carbonado.IsolationLevel;
import com.amazon.carbonado.Repository;
-import static com.amazon.carbonado.RepositoryBuilder.RepositoryReference;
import com.amazon.carbonado.RepositoryException;
import com.amazon.carbonado.Storable;
import com.amazon.carbonado.Storage;
@@ -38,14 +39,14 @@ import com.amazon.carbonado.capability.Capability; * @author Brian S O'Neill
*/
class LoggingRepository implements Repository, LogAccessCapability {
- private final RepositoryReference mRootRef;
+ private final AtomicReference<Repository> mRootRef;
private final Repository mRepo;
private final Log mLog;
// Map of storages by storable class
private final Map<Class<?>, LoggingStorage<?>> mStorages;
- LoggingRepository(RepositoryReference rootRef, Repository actual, Log log) {
+ LoggingRepository(AtomicReference<Repository> rootRef, Repository actual, Log log) {
mRootRef = rootRef;
mRepo = actual;
mLog = log;
diff --git a/src/main/java/com/amazon/carbonado/repo/logging/LoggingRepositoryBuilder.java b/src/main/java/com/amazon/carbonado/repo/logging/LoggingRepositoryBuilder.java index 5f06cd5..956c947 100644 --- a/src/main/java/com/amazon/carbonado/repo/logging/LoggingRepositoryBuilder.java +++ b/src/main/java/com/amazon/carbonado/repo/logging/LoggingRepositoryBuilder.java @@ -20,6 +20,8 @@ package com.amazon.carbonado.repo.logging; import java.util.Collection;
+import java.util.concurrent.atomic.AtomicReference;
+
import com.amazon.carbonado.ConfigurationException;
import com.amazon.carbonado.Repository;
import com.amazon.carbonado.RepositoryBuilder;
@@ -56,7 +58,7 @@ public class LoggingRepositoryBuilder extends AbstractRepositoryBuilder { public LoggingRepositoryBuilder() {
}
- public Repository build(RepositoryReference rootRef) throws RepositoryException {
+ public Repository build(AtomicReference<Repository> rootRef) throws RepositoryException {
if (mName == null) {
if (mRepoBuilder != null) {
mName = mRepoBuilder.getName();
|