Package org.datanucleus
Class NucleusContextHelper
- java.lang.Object
-
- org.datanucleus.NucleusContextHelper
-
public class NucleusContextHelper extends Object
Helper methods for NucleusContext operations.
-
-
Constructor Summary
Constructors Constructor Description NucleusContextHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StoreManager
createStoreManagerForProperties(Map<String,Object> props, Map<String,Object> datastoreProps, ClassLoaderResolver clr, NucleusContext nucCtx)
Method to create a StoreManager based on the specified properties passed in.static String
getTransactionIsolationForStoreManager(StoreManager storeMgr, String transactionIsolation)
Method to return the transaction isolation level that will be used for the provided StoreManager bearing in mind the specified level the user requested.
-
-
-
Field Detail
-
random
public static final Random random
Random number generator, for use when needing unique names.
-
-
Method Detail
-
getTransactionIsolationForStoreManager
public static String getTransactionIsolationForStoreManager(StoreManager storeMgr, String transactionIsolation)
Method to return the transaction isolation level that will be used for the provided StoreManager bearing in mind the specified level the user requested.- Parameters:
storeMgr
- The Store ManagertransactionIsolation
- Requested isolation level- Returns:
- Isolation level to use
- Throws:
TransactionIsolationNotSupportedException
- When no suitable level available given the requested level
-
createStoreManagerForProperties
public static StoreManager createStoreManagerForProperties(Map<String,Object> props, Map<String,Object> datastoreProps, ClassLoaderResolver clr, NucleusContext nucCtx)
Method to create a StoreManager based on the specified properties passed in.- Parameters:
props
- The overall persistence propertiesdatastoreProps
- Persistence properties to apply to the datastoreclr
- ClassLoader resolvernucCtx
- NucleusContext- Returns:
- The StoreManager
- Throws:
NucleusUserException
- if impossible to create the StoreManager (not in CLASSPATH?, invalid definition?)
-
-