Class ConnectorsUtil


  • public class ConnectorsUtil
    extends Object
    Util class for connector related classes
    • Constructor Detail

      • ConnectorsUtil

        public ConnectorsUtil()
    • Method Detail

      • belongsToSystemRA

        public static boolean belongsToSystemRA​(String raName)
        determine whether the RAR in question is a System RAR
        Parameters:
        raName - RarName
        Returns:
        boolean
      • getPingDuringPoolCreation

        public static boolean getPingDuringPoolCreation​(PoolInfo poolInfo,
                                                        Resources allResources)
      • belongsToJdbcRA

        public static boolean belongsToJdbcRA​(String raName)
        determine whether the RAR in question is a System RAR
        Parameters:
        raName - RarName
        Returns:
        boolean
      • getSystemModuleLocation

        public static String getSystemModuleLocation​(String moduleName)
        get the installation directory of System RARs
        Parameters:
        moduleName - RARName
        Returns:
        directory location
      • getPMJndiName

        public static String getPMJndiName​(String jndiName)
        Return the system PM name for the JNDI name
        Parameters:
        jndiName - jndi name
        Returns:
        String jndi name for PM resource
      • getValidSuffix

        public static String getValidSuffix​(String name)
        check whether the jndi Name has connector related suffix and return if any.
        Parameters:
        name - jndi name
        Returns:
        suffix, if found
      • isValidJndiSuffix

        public static boolean isValidJndiSuffix​(String suffix)
        If the suffix is one of the valid context return true. Return false, if that is not the case.
        Parameters:
        suffix - __nontx / __pm
        Returns:
        boolean whether the suffix is valid or not
      • deriveJndiName

        public static String deriveJndiName​(String name,
                                            Hashtable env)
        Given the name of the resource and its jndi env, derive the complete jndi name. (eg; with __PM / __nontx)
        Parameters:
        name - name of the resource
        env - env
        Returns:
        derived name
      • getAllPoolsOfModule

        public static Collection<ConnectorConnectionPool> getAllPoolsOfModule​(String moduleName,
                                                                              Resources allResources)
        get the pools for a particular resource-adapter
        Parameters:
        moduleName - resource-adapter name
        Returns:
        collection of connectorConnectionPool
      • getAllSystemRAResourcesAndPools

        public static Collection<Resource> getAllSystemRAResourcesAndPools​(Resources allResources)
        Get all System RAR pools and resources
        Parameters:
        allResources - all configured resources
        Returns:
        Collection of system RAR pools
      • getResourceAdapterNameOfPool

        public static String getResourceAdapterNameOfPool​(String poolName,
                                                          Resources allResources)
        Given the poolname, retrieve the resourceadapter name
        Parameters:
        poolName - connection pool name
        allResources - resources
        Returns:
        resource-adapter name
      • getWorkSecurityMaps

        public static List<WorkSecurityMap> getWorkSecurityMaps​(String raName,
                                                                Resources allResources)
        given the ra-name, returns all the configured connector-work-security-maps for the .rar
        Parameters:
        raName - resource-adapter name
        allResources - resources
        Returns:
        list of work-security-maps
      • isDynamicReconfigurationEnabled

        public static boolean isDynamicReconfigurationEnabled​(ResourcePool pool)
      • getMergedActivationConfigProperties

        public static Set getMergedActivationConfigProperties​(EjbMessageBeanDescriptor msgDesc)
        Prepares the name/value pairs for ActivationSpec.

        Rule:

        1. The name/value pairs are the union of activation-config on standard DD (message-driven) and runtime DD (mdb-resource-adapter) 2. If there are duplicate property settings, the value in runtime activation-config will overwrite the one in the standard activation-config.

      • isJMSRA

        public static boolean isJMSRA​(String moduleName)
      • parseBoolean

        public static boolean parseBoolean​(String enabled)
      • getShutdownTimeout

        public static long getShutdownTimeout​(ConnectorService connectorService)
        Gets the shutdown-timeout attribute from domain.xml via the connector server config bean.
        Parameters:
        connectorService - connector-service configuration
        Returns:
        long shutdown timeout (in mill-seconds)
      • getBuiltInCustomResources

        public static Map<String,​String> getBuiltInCustomResources()
        Provides the list of built in custom resources by resource-type and factory-class-name pair.
        Returns:
        map of resource-type & factory-class-name
      • getTransactionIsolationInt

        public static String getTransactionIsolationInt​(int tranIsolation)
      • getEmbeddedRarModuleName

        public static String getEmbeddedRarModuleName​(String applicationName,
                                                      String moduleName)
      • getApplicationNameOfEmbeddedRar

        public static String getApplicationNameOfEmbeddedRar​(String embeddedRarName)
      • getRarNameFromApplication

        public static String getRarNameFromApplication​(String appName)
      • getReservePrefixedJNDINameForDescriptor

        public static String getReservePrefixedJNDINameForDescriptor​(String moduleName)
      • isStandAloneRA

        public static boolean isStandAloneRA​(String moduleName)
      • getNonJdbcSystemRars

        public static Collection<String> getNonJdbcSystemRars()
      • systemRarExists

        public static boolean systemRarExists​(String location)
      • extractRar

        public static boolean extractRar​(String fileName,
                                         String rarName,
                                         String destDir)
        GlassFish (Embedded) Uber jar will have .rar bundled in it. This method will extract the .rar from the uber jar into specified directory. As of now, this method is only used in EMBEDDED mode
        Parameters:
        fileName - rar-directory-name
        rarName - resource-adapter name
        destDir - destination directory
        Returns:
        status indicating whether .rar is exploded successfully or not
      • getApplicationName

        public static String getApplicationName​(Resource resource)
      • getApplicationName

        public static String getApplicationName​(PoolInfo poolInfo)
      • isApplicationScopedResource

        public static boolean isApplicationScopedResource​(GenericResourceInfo resourceInfo)
      • isModuleScopedResource

        public static boolean isModuleScopedResource​(GenericResourceInfo resourceInfo)
      • escapeResourceNameForMonitoring

        public static String escapeResourceNameForMonitoring​(String name)
      • getPoolMonitoringSubTreeRoot

        public static String getPoolMonitoringSubTreeRoot​(PoolInfo poolInfo,
                                                          boolean escapeSlashes)
      • getActualModuleName

        public static String getActualModuleName​(String moduleName)
      • isRARResource

        public static boolean isRARResource​(Resource resource)