org.jboss.jca.deployers.common

## Class AbstractDsDeployer

- java.lang.Object
- - org.jboss.jca.deployers.common.AbstractDsDeployer

-     public abstract class AbstractDsDeployer
      extends java.lang.Object

  An abstract deployer implementation for datasources
  Author:
    Stefano Maestri, Jesper Pedersen

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected DeployersLogger` | `log` log
    `protected org.jboss.jca.core.spi.transaction.TransactionIntegration` | `transactionIntegration` The transaction integration
    `protected org.jboss.jca.core.spi.transaction.recovery.XAResourceRecoveryRegistry` | `xaResourceRecoveryRegistry` xaResourceRecoveryRegistry

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractDsDeployer()` Create a new AbstractDsDeployer.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `associateResourceAdapter(javax.resource.spi.ResourceAdapter resourceAdapter, java.lang.Object object)` Associate resource adapter with ojects if they implement ResourceAdapterAssociation
    `protected abstract java.lang.String[]` | `bindConnectionFactory(java.lang.String deployment, java.lang.String jndi, java.lang.Object cf)` Bind connection factory into JNDI
    `protected java.lang.String` | `buildJndiName(java.lang.String jndiName, java.lang.Boolean javaContext)` Build the jndi name
    `protected abstract javax.resource.spi.ManagedConnectionFactory` | `createMcf(org.jboss.jca.common.api.metadata.ds.DataSource ds, java.lang.String uniqueId, java.lang.ClassLoader cl)` Create Mcf for ds
    `protected abstract javax.resource.spi.ManagedConnectionFactory` | `createMcf(org.jboss.jca.common.api.metadata.ds.XaDataSource ds, java.lang.String uniqueId, java.lang.ClassLoader cl)` Create Mcf for xads
    `protected CommonDeployment` | `createObjectsAndInjectValue(java.net.URL url, java.lang.String deploymentName, java.lang.String uniqueJdbcLocalId, java.lang.String uniqueJdbcXAId, org.jboss.jca.common.api.metadata.ds.DataSources dataSources, java.lang.ClassLoader parentClassLoader)` create objects and inject value for this depployment. it is a general method returning a `CommonDeployment` to be used to exchange objects needed to real injection in the container
    `protected abstract javax.resource.spi.ResourceAdapter` | `createRa(java.lang.String uniqueId, java.lang.ClassLoader cl)` Create Ra
    `protected javax.security.auth.Subject` | `createSubject(org.jboss.jca.core.spi.security.SubjectFactory subjectFactory, java.lang.String securityDomain, javax.resource.spi.ManagedConnectionFactory mcf, java.lang.String jndiName)` Create a subject
    `org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager` | `getCachedConnectionManager()` Get the ccm
    `protected abstract java.lang.ClassLoader` | `getDeploymentClassLoader(java.lang.String uniqueId)` Provide the classloader of the deployment identified by the unique id
    `protected java.lang.String` | `getDriver(java.lang.String driverName, java.lang.String moduleId)` Get the driver
    `protected abstract DeployersLogger` | `getLogger()` Get the logger
    `org.jboss.jca.core.api.management.ManagementRepository` | `getManagementRepository()` Get the managementRepository.
    `protected abstract org.jboss.jca.core.spi.security.SubjectFactory` | `getSubjectFactory(org.jboss.jca.common.api.metadata.common.Credential credential, java.lang.String jndiName)` Get a subject factory
    `org.jboss.jca.core.spi.transaction.TransactionIntegration` | `getTransactionIntegration()` Get the transaction integration
    `org.jboss.jca.core.spi.transaction.recovery.XAResourceRecoveryRegistry` | `getXAResourceRecoveryRegistry()` Get the xAResourceRecoveryRegistry.
    `protected abstract java.lang.Object` | `initAndInject(java.lang.String className, java.util.List<? extends org.jboss.jca.common.api.metadata.spec.ConfigProperty> configs, java.lang.ClassLoader cl)` Initialize and inject configuration properties
    `protected void` | `initAndInjectClassLoaderPlugin(javax.resource.spi.ManagedConnectionFactory mcf, org.jboss.jca.common.api.metadata.ds.CommonDataSource dsMetadata)` Initialize and inject class loader plugin
    `protected boolean` | `needsBootstrapContext(org.jboss.jca.common.api.metadata.ds.DataSources datasources)` Needs a BootstrapContext instance
    `protected int` | `numberOfDataSources(org.jboss.jca.common.api.metadata.ds.DataSources datasources)` Get the number of datasource deployments
    `protected abstract java.lang.String` | `registerResourceAdapterToResourceAdapterRepository(javax.resource.spi.ResourceAdapter instance)` Register the ResourceAdapter to the ResourceAdapterRepository.
    `void` | `setCachedConnectionManager(org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager value)` Set the ccm
    `void` | `setManagementRepository(org.jboss.jca.core.api.management.ManagementRepository managementRepository)` Set the managementRepository.
    `void` | `setTransactionIntegration(org.jboss.jca.core.spi.transaction.TransactionIntegration value)` Set the transaction integration
    `void` | `setXAResourceRecoveryRegistry(org.jboss.jca.core.spi.transaction.recovery.XAResourceRecoveryRegistry xAResourceRecoveryRegistry)` Set the xAResourceRecoveryRegistry.
    `protected void` | `startContext(javax.resource.spi.ResourceAdapter resourceAdapter, java.lang.String bootstrapContextIdentifier)` Start the resource adapter
    `protected boolean` | `verifyTypes(org.jboss.jca.common.api.metadata.ds.DataSources datasources)` Verify the types of the datasources

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### log

          protected DeployersLogger log

      log

    - #### transactionIntegration

          protected org.jboss.jca.core.spi.transaction.TransactionIntegration transactionIntegration

      The transaction integration

    - #### xaResourceRecoveryRegistry

          protected org.jboss.jca.core.spi.transaction.recovery.XAResourceRecoveryRegistry xaResourceRecoveryRegistry

      xaResourceRecoveryRegistry

  - ### Constructor Detail

    - #### AbstractDsDeployer

          public AbstractDsDeployer()

      Create a new AbstractDsDeployer.

  - ### Method Detail

    - #### setTransactionIntegration

          public void setTransactionIntegration(org.jboss.jca.core.spi.transaction.TransactionIntegration value)

      Set the transaction integration
      Parameters:
        `value` - The value

    - #### getTransactionIntegration

          public org.jboss.jca.core.spi.transaction.TransactionIntegration getTransactionIntegration()

      Get the transaction integration
      Returns:
        The value

    - #### getManagementRepository

          public org.jboss.jca.core.api.management.ManagementRepository getManagementRepository()

      Get the managementRepository.
      Returns:
        the managementRepository.

    - #### setManagementRepository

          public void setManagementRepository(org.jboss.jca.core.api.management.ManagementRepository managementRepository)

      Set the managementRepository.
      Parameters:
        `managementRepository` - The managementRepository to set.

    - #### setCachedConnectionManager

          public void setCachedConnectionManager(org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager value)

      Set the ccm
      Parameters:
        `value` - The value

    - #### getCachedConnectionManager

          public org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager getCachedConnectionManager()

      Get the ccm
      Returns:
        The handle

    - #### getXAResourceRecoveryRegistry

          public org.jboss.jca.core.spi.transaction.recovery.XAResourceRecoveryRegistry getXAResourceRecoveryRegistry()

      Get the xAResourceRecoveryRegistry.
      Returns:
        the xAResourceRecoveryRegistry.

    - #### setXAResourceRecoveryRegistry

          public void setXAResourceRecoveryRegistry(org.jboss.jca.core.spi.transaction.recovery.XAResourceRecoveryRegistry xAResourceRecoveryRegistry)

      Set the xAResourceRecoveryRegistry.
      Parameters:
        `xAResourceRecoveryRegistry` - The xAResourceRecoveryRegistry to set.

    - #### createObjectsAndInjectValue

          protected CommonDeployment createObjectsAndInjectValue(java.net.URL url,
                                                                 java.lang.String deploymentName,
                                                                 java.lang.String uniqueJdbcLocalId,
                                                                 java.lang.String uniqueJdbcXAId,
                                                                 org.jboss.jca.common.api.metadata.ds.DataSources dataSources,
                                                                 java.lang.ClassLoader parentClassLoader)
                                                          throws DeployException

      create objects and inject value for this depployment. it is a general method returning a `CommonDeployment` to be used to exchange objects needed to real injection in the container
      Parameters:
        `url` - url
        `deploymentName` - deploymentName
        `uniqueJdbcLocalId` - uniqueJdbcLocalId
        `uniqueJdbcXAId` - uniqueJdbcXAId
        `parentClassLoader` - cl
        `dataSources` - datasources metadata defined in xml
      Returns:
        return the exchange POJO with value useful for injection in the container (fungal or AS)
      Throws:
        `DeployException` - DeployException

    - #### buildJndiName

          protected java.lang.String buildJndiName(java.lang.String jndiName,
                                                   java.lang.Boolean javaContext)

      Build the jndi name
      Parameters:
        `jndiName` - The jndi name
        `javaContext` - The java context
      Returns:
        The value

    - #### getDriver

          protected java.lang.String getDriver(java.lang.String driverName,
                                               java.lang.String moduleId)

      Get the driver
      Parameters:
        `driverName` - The name of the driver
        `moduleId` - The id of the module
      Returns:
        The driver class name; or `null` if not found

    - #### numberOfDataSources

          protected int numberOfDataSources(org.jboss.jca.common.api.metadata.ds.DataSources datasources)

      Get the number of datasource deployments
      Parameters:
        `datasources` - The datasources
      Returns:
        The number

    - #### verifyTypes

          protected boolean verifyTypes(org.jboss.jca.common.api.metadata.ds.DataSources datasources)

      Verify the types of the datasources
      Parameters:
        `datasources` - The datasources
      Returns:
        True if all datasources fall into the same caterogy, otherwise false

    - #### needsBootstrapContext

          protected boolean needsBootstrapContext(org.jboss.jca.common.api.metadata.ds.DataSources datasources)

      Needs a BootstrapContext instance
      Parameters:
        `datasources` - The datasources
      Returns:
        True if needs a context

    - #### startContext

          protected void startContext(javax.resource.spi.ResourceAdapter resourceAdapter,
                                      java.lang.String bootstrapContextIdentifier)
                               throws DeployException

      Start the resource adapter
      Parameters:
        `resourceAdapter` - The resource adapter
        `bootstrapContextIdentifier` - The bootstrap context identifier
      Throws:
        `DeployException` - DeployException Thrown if the resource adapter cant be started

    - #### associateResourceAdapter

          protected void associateResourceAdapter(javax.resource.spi.ResourceAdapter resourceAdapter,
                                                  java.lang.Object object)
                                           throws DeployException

      Associate resource adapter with ojects if they implement ResourceAdapterAssociation
      Parameters:
        `resourceAdapter` - resourceAdapter resourceAdapter The resource adapter
        `object` - object object The of possible association object
      Throws:
        `DeployException` - DeployException Thrown if the resource adapter cant be started

    - #### createRa

          protected abstract javax.resource.spi.ResourceAdapter createRa(java.lang.String uniqueId,
                                                                         java.lang.ClassLoader cl)
                                                                  throws org.jboss.jca.core.spi.mdr.NotFoundException,
                                                                         java.lang.Exception,
                                                                         DeployException

      Create Ra
      Parameters:
        `uniqueId` - the uniqueId
        `cl` - the classloader
      Returns:
        the resource adapter
      Throws:
        `org.jboss.jca.core.spi.mdr.NotFoundException` - in case it's not found in cl
        `java.lang.Exception` - in case of other error
        `DeployException` - in case of deploy error

    - #### registerResourceAdapterToResourceAdapterRepository

          protected abstract java.lang.String registerResourceAdapterToResourceAdapterRepository(javax.resource.spi.ResourceAdapter instance)

      Register the ResourceAdapter to the ResourceAdapterRepository. Implementer should provide the implementation to get repository and do the registration
      Parameters:
        `instance` - the instance
      Returns:
        The key

    - #### createMcf

          protected abstract javax.resource.spi.ManagedConnectionFactory createMcf(org.jboss.jca.common.api.metadata.ds.XaDataSource ds,
                                                                                   java.lang.String uniqueId,
                                                                                   java.lang.ClassLoader cl)
                                                                            throws org.jboss.jca.core.spi.mdr.NotFoundException,
                                                                                   java.lang.Exception,
                                                                                   DeployException

      Create Mcf for xads
      Parameters:
        `ds` - the xsds
        `uniqueId` - the uniqueId
        `cl` - the classloader
      Returns:
        the mcf
      Throws:
        `org.jboss.jca.core.spi.mdr.NotFoundException` - in case it's not found in cl
        `java.lang.Exception` - in case of other errro
        `DeployException` - in case of deoloy error

    - #### createMcf

          protected abstract javax.resource.spi.ManagedConnectionFactory createMcf(org.jboss.jca.common.api.metadata.ds.DataSource ds,
                                                                                   java.lang.String uniqueId,
                                                                                   java.lang.ClassLoader cl)
                                                                            throws org.jboss.jca.core.spi.mdr.NotFoundException,
                                                                                   java.lang.Exception,
                                                                                   DeployException

      Create Mcf for ds
      Parameters:
        `ds` - the xsds
        `uniqueId` - the uniqueId
        `cl` - the classloader
      Returns:
        the mcf
      Throws:
        `org.jboss.jca.core.spi.mdr.NotFoundException` - in case it's not found in cl
        `java.lang.Exception` - in case of other errro
        `DeployException` - in case of deoloy error

    - #### getDeploymentClassLoader

          protected abstract java.lang.ClassLoader getDeploymentClassLoader(java.lang.String uniqueId)

      Provide the classloader of the deployment identified by the unique id
      Parameters:
        `uniqueId` - The
      Returns:
        The classloader used by this deployment

    - #### bindConnectionFactory

          protected abstract java.lang.String[] bindConnectionFactory(java.lang.String deployment,
                                                                      java.lang.String jndi,
                                                                      java.lang.Object cf)
                                                               throws java.lang.Throwable

      Bind connection factory into JNDI
      Parameters:
        `deployment` - The deployment name
        `cf` - The connection factory
        `jndi` - passed jndi name
      Returns:
        The JNDI names bound
      Throws:
        `java.lang.Throwable` - Thrown if an error occurs

    - #### initAndInject

          protected abstract java.lang.Object initAndInject(java.lang.String className,
                                                            java.util.List<? extends org.jboss.jca.common.api.metadata.spec.ConfigProperty> configs,
                                                            java.lang.ClassLoader cl)
                                                     throws DeployException

      Initialize and inject configuration properties
      Parameters:
        `className` - The fully qualified class name
        `configs` - The configuration properties
        `cl` - The class loader
      Returns:
        The object
      Throws:
        `DeployException` - Thrown if the object cant be initialized

    - #### initAndInjectClassLoaderPlugin

          protected void initAndInjectClassLoaderPlugin(javax.resource.spi.ManagedConnectionFactory mcf,
                                                        org.jboss.jca.common.api.metadata.ds.CommonDataSource dsMetadata)
                                                 throws DeployException

      Initialize and inject class loader plugin
      Parameters:
        `mcf` - The managed connection factory
        `dsMetadata` - The dataSource metadata
      Throws:
        `DeployException` - Thrown if the object cant be initialized or injected

    - #### getSubjectFactory

          protected abstract org.jboss.jca.core.spi.security.SubjectFactory getSubjectFactory(org.jboss.jca.common.api.metadata.common.Credential credential,
                                                                                              java.lang.String jndiName)
                                                                                       throws DeployException

      Get a subject factory
      Parameters:
        `credential` - The security credential
        `jndiName` - optionally used for authentication context matching
      Returns:
        The subject factory; must return `null` if credential security isn't enabled or if credential is `null`
      Throws:
        `DeployException` - Thrown if the security info can't be resolved

    - #### getLogger

          protected abstract DeployersLogger getLogger()

      Get the logger
      Returns:
        The value

    - #### createSubject

          protected javax.security.auth.Subject createSubject(org.jboss.jca.core.spi.security.SubjectFactory subjectFactory,
                                                              java.lang.String securityDomain,
                                                              javax.resource.spi.ManagedConnectionFactory mcf,
                                                              java.lang.String jndiName)

      Create a subject
      Parameters:
        `subjectFactory` - The subject factory
        `securityDomain` - The security domain
        `mcf` - The managed connection factory
        `jndiName` - The jndi-name of the data-source
      Returns:
        The subject; `null` in case of an error

Copyright © 2014 IronJacamar (http://www.ironjacamar.org)