diff options
Diffstat (limited to 'src/main/java/com/amazon/carbonado/repo/jdbc')
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepository.java | 7 | ||||
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepositoryBuilder.java | 5 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepository.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepository.java index 97be915..bcdd0c4 100644 --- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepository.java +++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepository.java @@ -24,6 +24,8 @@ import java.sql.SQLException; import java.util.Map;
import java.util.IdentityHashMap;
+import java.util.concurrent.atomic.AtomicReference;
+
import javax.sql.DataSource;
import org.apache.commons.logging.Log;
@@ -39,7 +41,6 @@ import com.amazon.carbonado.SupportException; import com.amazon.carbonado.MalformedTypeException;
import com.amazon.carbonado.PersistException;
import com.amazon.carbonado.Repository;
-import static com.amazon.carbonado.RepositoryBuilder.RepositoryReference;
import com.amazon.carbonado.RepositoryException;
import com.amazon.carbonado.Transaction;
import com.amazon.carbonado.UnsupportedTypeException;
@@ -134,7 +135,7 @@ public class JDBCRepository private final String mName;
final boolean mIsMaster;
- private final RepositoryReference mRootRef;
+ private final AtomicReference<Repository> mRootRef;
private final String mDatabaseProductName;
private final DataSource mDataSource;
private final String mCatalog;
@@ -176,7 +177,7 @@ public class JDBCRepository * database independent
*/
@SuppressWarnings("unchecked")
- JDBCRepository(RepositoryReference rootRef,
+ JDBCRepository(AtomicReference<Repository> rootRef,
String name, boolean isMaster,
DataSource dataSource, String catalog, String schema)
throws RepositoryException
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepositoryBuilder.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepositoryBuilder.java index 507d70a..3a797e8 100644 --- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepositoryBuilder.java +++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepositoryBuilder.java @@ -21,9 +21,12 @@ package com.amazon.carbonado.repo.jdbc; import java.sql.SQLException;
import java.util.Collection;
+import java.util.concurrent.atomic.AtomicReference;
+
import javax.sql.DataSource;
import com.amazon.carbonado.ConfigurationException;
+import com.amazon.carbonado.Repository;
import com.amazon.carbonado.RepositoryException;
import com.amazon.carbonado.spi.AbstractRepositoryBuilder;
@@ -66,7 +69,7 @@ public class JDBCRepositoryBuilder extends AbstractRepositoryBuilder { public JDBCRepositoryBuilder() {
}
- public JDBCRepository build(RepositoryReference rootRef) throws RepositoryException {
+ public JDBCRepository build(AtomicReference<Repository> rootRef) throws RepositoryException {
assertReady();
JDBCRepository repo = new JDBCRepository
(rootRef, getName(), isMaster(), getDataSource(), mCatalog, mSchema);
|