org.jboss.jca.deployers.common
Class AbstractDsDeployer

java.lang.Object
  extended by org.jboss.jca.deployers.common.AbstractDsDeployer

public abstract class AbstractDsDeployer
extends Object

An abstract deployer implementation for datasources

Author:
Stefano Maestri, Jesper Pedersen

Field Summary
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
AbstractDsDeployer()
          Create a new AbstractDsDeployer.
 
Method Summary
protected abstract  String[] bindConnectionFactory(String deployment, String jndi, Object cf)
          Bind connection factory into JNDI
protected  String buildJndiName(String jndiName, Boolean javaContext)
          Build the jndi name
protected abstract  javax.resource.spi.ManagedConnectionFactory createMcf(org.jboss.jca.common.api.metadata.ds.DataSource ds, String uniqueId, ClassLoader cl)
          Create Mcf for ds
protected abstract  javax.resource.spi.ManagedConnectionFactory createMcf(org.jboss.jca.common.api.metadata.ds.XaDataSource ds, String uniqueId, ClassLoader cl)
          Create Mcf for xads
protected  CommonDeployment createObjectsAndInjectValue(URL url, String deploymentName, String uniqueJdbcLocalId, String uniqueJdbcXAId, org.jboss.jca.common.api.metadata.ds.DataSources dataSources, ClassLoader parentClassLoader)
          create objects and inject value for this depployment.
protected  Subject createSubject(org.jboss.security.SubjectFactory subjectFactory, String securityDomain, javax.resource.spi.ManagedConnectionFactory mcf)
          Create a subject
 org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager getCachedConnectionManager()
          Get the ccm
protected abstract  ClassLoader getDeploymentClassLoader(String uniqueId)
          Provide the classloader of the deployment identified by the unique id
protected  String getDriver(String driverName, 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.security.SubjectFactory getSubjectFactory(String securityDomain)
          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  Object initAndInject(String className, List<? extends org.jboss.jca.common.api.metadata.ra.ConfigProperty> configs, 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
 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.
 
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(URL url,
                                                       String deploymentName,
                                                       String uniqueJdbcLocalId,
                                                       String uniqueJdbcXAId,
                                                       org.jboss.jca.common.api.metadata.ds.DataSources dataSources,
                                                       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 String buildJndiName(String jndiName,
                               Boolean javaContext)
Build the jndi name

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

getDriver

protected String getDriver(String driverName,
                           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

createMcf

protected abstract javax.resource.spi.ManagedConnectionFactory createMcf(org.jboss.jca.common.api.metadata.ds.XaDataSource ds,
                                                                         String uniqueId,
                                                                         ClassLoader cl)
                                                                  throws org.jboss.jca.core.spi.mdr.NotFoundException,
                                                                         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
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,
                                                                         String uniqueId,
                                                                         ClassLoader cl)
                                                                  throws org.jboss.jca.core.spi.mdr.NotFoundException,
                                                                         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
Exception - in case of other errro
DeployException - in case of deoloy error

getDeploymentClassLoader

protected abstract ClassLoader getDeploymentClassLoader(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 String[] bindConnectionFactory(String deployment,
                                                  String jndi,
                                                  Object cf)
                                           throws 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:
Throwable - Thrown if an error occurs

initAndInject

protected abstract Object initAndInject(String className,
                                        List<? extends org.jboss.jca.common.api.metadata.ra.ConfigProperty> configs,
                                        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.security.SubjectFactory getSubjectFactory(String securityDomain)
                                                                throws DeployException
Get a subject factory

Parameters:
securityDomain - The security domain
Returns:
The subject factory; must return null if security domain isn't defined
Throws:
DeployException - Thrown if the security domain can't be resolved

getLogger

protected abstract DeployersLogger getLogger()
Get the logger

Returns:
The value

createSubject

protected Subject createSubject(org.jboss.security.SubjectFactory subjectFactory,
                                String securityDomain,
                                javax.resource.spi.ManagedConnectionFactory mcf)
Create a subject

Parameters:
subjectFactory - The subject factory
securityDomain - The security domain
mcf - The managed connection factory
Returns:
The subject; null in case of an error


Copyright © 2008 Red Hat Middleware LLC (http://www.jboss.com/)