public interface ContextualEnvironment extends Environment
ContextualEnvironment is always aware of transaction started in current thread. Its openStore()
methods return ContextualStore instances.Environment,
ContextualStore| Modifier and Type | Method and Description |
|---|---|
@NotNull java.util.List<java.lang.String> |
getAllStoreNames()
This method is equivalent to Environment.getAllStoreNames(Transaction):
|
@NotNull Transaction |
getAndCheckCurrentTransaction() |
@Nullable Transaction |
getCurrentTransaction() |
@NotNull ContextualStore |
openStore(@NotNull java.lang.String name,
@NotNull StoreConfig config)
|
@Nullable ContextualStore |
openStore(@NotNull java.lang.String name,
@NotNull StoreConfig config,
boolean creationRequired)
|
@NotNull ContextualStore |
openStore(@NotNull java.lang.String name,
@NotNull StoreConfig config,
@NotNull Transaction transaction)
|
@Nullable ContextualStore |
openStore(@NotNull java.lang.String name,
@NotNull StoreConfig config,
@NotNull Transaction transaction,
boolean creationRequired)
|
beginExclusiveTransaction, beginExclusiveTransaction, beginReadonlyTransaction, beginReadonlyTransaction, beginTransaction, beginTransaction, clear, close, computeInExclusiveTransaction, computeInReadonlyTransaction, computeInTransaction, executeInExclusiveTransaction, executeInReadonlyTransaction, executeInTransaction, executeTransactionSafeTask, gc, getAllStoreNames, getCipherBasicIV, getCipherKey, getCipherProvider, getCreated, getEnvironmentConfig, getLocation, getStatistics, isOpen, removeStore, resumeGC, storeExists, suspendGC, truncateStoregetBackupStrategy@NotNull @NotNull ContextualStore openStore(@NotNull @NotNull java.lang.String name, @NotNull @NotNull StoreConfig config)
name and
config inside transaction started in current thread. Internally, it calls
getAndCheckCurrentTransaction() to ensure that transaction started in current thread exists.
StoreConfig provides meta-information used to create store. If it is known that the store
with specified name exists, then StoreConfig.USE_EXISTING can be used.name - name of storeconfig - StoreConfig used to create storeContextualStore,
StoreConfig@Nullable @Nullable ContextualStore openStore(@NotNull @NotNull java.lang.String name, @NotNull @NotNull StoreConfig config, boolean creationRequired)
name and
config inside transaction started in current thread. Internally, it calls
getAndCheckCurrentTransaction() to ensure that transaction started in current thread exists.
StoreConfig provides meta-information used to create store. If it is known that the store
with specified name exists, then StoreConfig.USE_EXISTING can be used.
true as creationRequired if creating new store is required or allowed. In that case,
the method will do the same as openStore(String, StoreConfig). If you pass
false the method will return null for non-existing store.name - name of storeconfig - StoreConfig used to create storecreationRequired - pass false if you wish to get null for non-existing store
rather than create it.ContextualStore,
StoreConfig@NotNull @NotNull ContextualStore openStore(@NotNull @NotNull java.lang.String name, @NotNull @NotNull StoreConfig config, @NotNull @NotNull Transaction transaction)
Environmentname and
config inside a transaction. StoreConfig provides meta-information
used to create store. If it is known that the store with specified name exists, then
StoreConfig.USE_EXISTING can be used.openStore in interface Environmentname - name of storeconfig - StoreConfig used to create storetransaction - Transaction used to create store@Nullable @Nullable ContextualStore openStore(@NotNull @NotNull java.lang.String name, @NotNull @NotNull StoreConfig config, @NotNull @NotNull Transaction transaction, boolean creationRequired)
Environmentname and
config inside a transaction. StoreConfig provides meta-information
used to create the store. If it is known that the store with specified name exists, then
StoreConfig.USE_EXISTING can be used.
true as creationRequired if creating new store is required or allowed. In that case,
the method will do the same as Environment.openStore(String, StoreConfig, Transaction). If you pass
false the method will return null for non-existing store.openStore in interface Environmentname - name of storeconfig - StoreConfig used to create storetransaction - Transaction used to create storecreationRequired - pass false if you wish to get null for non-existing store
rather than create it@Nullable @Nullable Transaction getCurrentTransaction()
null if no transaction is started in current threadTransaction@NotNull @NotNull Transaction getAndCheckCurrentTransaction()
ExodusException - if there is no transaction started in current threadTransaction@NotNull @NotNull java.util.List<java.lang.String> getAllStoreNames()
List stores = getAllStoreNames(getAndCheckCurrentTransaction());
Environment.getAllStoreNames(Transaction)