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  org.jboss.logging.Logger log
          log
protected  org.jboss.jca.core.spi.mdr.MetadataRepository mdr
          Metadata repository
protected  TransactionManager transactionManager
          The transaction manager
 
Constructor Summary
AbstractDsDeployer(org.jboss.logging.Logger log)
          Create a new AbstractDsDeployer.
 
Method Summary
protected abstract  String[] bindConnectionFactory(String deployment, String jndi, Object cf)
          Bind connection factory into JNDI
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 abstract  ClassLoader getDeploymentClassLoader(String uniqueId)
          Provide the classloader of the deployment identified by the unique id
 org.jboss.jca.core.spi.mdr.MetadataRepository getMetadataRepository()
          Get the metadata repository
 TransactionManager getTransactionManager()
          Get the transaction manager
protected abstract  Object initAndInject(String className, List<? extends org.jboss.jca.common.api.metadata.ra.ConfigProperty> configs, ClassLoader cl)
          Initialize and inject configuration properties
 void setMetadataRepository(org.jboss.jca.core.spi.mdr.MetadataRepository value)
          Set the metadata repository
 void setTransactionManager(TransactionManager value)
          Set the transaction manager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.jboss.logging.Logger log
log


transactionManager

protected TransactionManager transactionManager
The transaction manager


mdr

protected org.jboss.jca.core.spi.mdr.MetadataRepository mdr
Metadata repository

Constructor Detail

AbstractDsDeployer

public AbstractDsDeployer(org.jboss.logging.Logger log)
Create a new AbstractDsDeployer.

Parameters:
log - The logger
Method Detail

setTransactionManager

public void setTransactionManager(TransactionManager value)
Set the transaction manager

Parameters:
value - The value

getTransactionManager

public TransactionManager getTransactionManager()
Get the transaction manager

Returns:
The value

setMetadataRepository

public void setMetadataRepository(org.jboss.jca.core.spi.mdr.MetadataRepository value)
Set the metadata repository

Parameters:
value - The value

getMetadataRepository

public org.jboss.jca.core.spi.mdr.MetadataRepository getMetadataRepository()
Get the metadata repository

Returns:
The handle

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
parentClassLoader - cl
raDeployments - resource adapters deployments
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

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


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