Class NucleusContextHelper


  • public class NucleusContextHelper
    extends Object
    Helper methods for NucleusContext operations.
    • Field Detail

      • random

        public static final Random random
        Random number generator, for use when needing unique names.
    • Constructor Detail

      • NucleusContextHelper

        public NucleusContextHelper()
    • 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 Manager
        transactionIsolation - 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 properties
        datastoreProps - Persistence properties to apply to the datastore
        clr - ClassLoader resolver
        nucCtx - NucleusContext
        Returns:
        The StoreManager
        Throws:
        NucleusUserException - if impossible to create the StoreManager (not in CLASSPATH?, invalid definition?)