Class ConnectionPoolObjectsUtils


  • public final class ConnectionPoolObjectsUtils
    extends Object
    This is an util class for creating poolObjects of the type ConnectorConnectionPool from ConnectorDescriptor and also using the default values.
    Author:
    Srikanth P
    • Method Detail

      • createDefaultConnectorPoolObject

        public static ConnectorConnectionPool createDefaultConnectorPoolObject​(PoolInfo poolInfo,
                                                                               String rarName)
        Creates default ConnectorConnectionPool consisting of default pool values.
        Parameters:
        poolInfo - Name of the pool
        Returns:
        ConnectorConnectionPool created ConnectorConnectionPool instance
      • createSunRaConnectorPoolObject

        public static ConnectorConnectionPool createSunRaConnectorPoolObject​(PoolInfo poolInfo,
                                                                             ConnectorDescriptor desc,
                                                                             String rarName)
        Creates ConnectorConnectionPool object pertaining to the pool props mentioned in the sun-ra/xml i.e it represents the pool mentioned in the sun-ra.xm.
        Parameters:
        poolInfo - Name of the pool
        desc - ConnectorDescriptor which represent ra.xml and sun-ra.xml.
        Returns:
        ConnectorConnectionPool created ConnectorConnectionPool instance
      • convertSpecTxSupportToContainerTxSupport

        public static int convertSpecTxSupportToContainerTxSupport​(jakarta.resource.spi.TransactionSupport.TransactionSupportLevel mcfTS)
        Return the interger representation container transaction support value equivalent to the jakarta.resource.spi.TransactionSupport enum value.
        Parameters:
        mcfTS - jakarta.resource.spi.TransactionSupport
        Returns:
        container equivalent value
      • parseTransactionSupportString

        public static int parseTransactionSupportString​(String txSupport)
        Return the integer representation of the transaction-support attribure
        Parameters:
        txSupport - one of
        • NoTransaction
        • LocalTransaction
        • XATransaction
        Returns:
        one of
        • ConnectorConstants.UNDEFINED_TRANSACTION_INT
        • ConnectorConstants.NO_TRANSACTION_INT
        • ConnectorConstants.LOCAL_TRANSACTION_INT
        • ConnectorConstants.XA_TRANSACTION_INT
      • isTxSupportConfigurationSane

        public static boolean isTxSupportConfigurationSane​(int txSupport,
                                                           String raName)
      • getTransactionSupport

        public static TransactionSupport getTransactionSupport​(int ts)
        A utility method to map TransactionSupport ints as represented in ConnectorConstants to the new TransactionSupport enum
      • getValueFromMCF

        public static String getValueFromMCF​(String prop,
                                             PoolInfo poolInfo,
                                             jakarta.resource.spi.ManagedConnectionFactory mcf)
      • createSubject

        public static Subject createSubject​(jakarta.resource.spi.ManagedConnectionFactory mcf,
                                            ResourcePrincipal prin)
      • isPoolSystemPool

        public static boolean isPoolSystemPool​(String poolName)
      • setLazyEnlistAndLazyAssocProperties

        public static void setLazyEnlistAndLazyAssocProperties​(String lazyAssocString,
                                                               List<Property> properties,
                                                               ConnectorConnectionPool conConnPool)
        Validates and sets the values for LazyConnectionEnlistment and LazyConnectionAssociation.
        Parameters:
        lazyAssocString - Property value
        adminPool - Config Bean
        conConnPool - Connector Connection Pool