org.jboss.jca.deployers.fungal
Class AbstractResourceAdapterDeployer

java.lang.Object
  extended by org.jboss.jca.deployers.fungal.AbstractResourceAdapterDeployer
Direct Known Subclasses:
RAActivator, RADeployer, RaXmlDeployer

public abstract class AbstractResourceAdapterDeployer
extends Object

An abstract resource adapter deployer which contains common functionality for all resource adapter archive based deployers.

Author:
Jesper Pedersen

Method Summary
protected  void associateResourceAdapter(javax.resource.spi.ResourceAdapter resourceAdapter, Object object)
          Associate resource adapter with ojects if they implement ResourceAdapterAssociation
protected  String[] bindConnectionFactory(URL url, String deployment, Object cf)
          Bind connection factory into JNDI
protected  String[] bindConnectionFactory(URL url, String deployment, Object cf, String jndi)
          Bind connection factory into JNDI
protected  org.jboss.jca.core.connectionmanager.pool.api.PoolConfiguration createPoolConfiguration(org.jboss.jca.common.api.metadata.common.CommonPool pp, org.jboss.jca.common.api.metadata.common.CommonTimeOut tp, org.jboss.jca.common.api.metadata.common.CommonValidation vp)
          Create an instance of the pool configuration based on the input
protected  org.jboss.jca.common.api.metadata.common.CommonConnDef findConnectionDefinition(String clz, List<org.jboss.jca.common.api.metadata.common.CommonConnDef> defs)
          Find the connection factory for a managed connection factory
 RAConfiguration getConfiguration()
          Get the configuration
protected  URL[] getUrls(File directory)
          Get the URLs for the directory and all libraries located in the directory
protected  boolean hasFailuresLevel(Collection<org.jboss.jca.validator.Failure> failures, int severity)
          Cehck for failures at a certain level
protected  Object initAndInject(String className, List<? extends org.jboss.jca.common.api.metadata.ra.ConfigProperty> configs, ClassLoader cl)
          Initialize and inject configuration properties
 void setConfiguration(RAConfiguration value)
          Set the configuration
 void start()
          Start
protected  void startContext(javax.resource.spi.ResourceAdapter resourceAdapter, String bootstrapIdentifier)
          Start the resource adapter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setConfiguration

public void setConfiguration(RAConfiguration value)
Set the configuration

Parameters:
value - The value

getConfiguration

public RAConfiguration getConfiguration()
Get the configuration

Returns:
The value

hasFailuresLevel

protected boolean hasFailuresLevel(Collection<org.jboss.jca.validator.Failure> failures,
                                   int severity)
Cehck for failures at a certain level

Parameters:
failures - The failures
severity - The level
Returns:
True if a failure is found with the specified severity; otherwise false

startContext

protected void startContext(javax.resource.spi.ResourceAdapter resourceAdapter,
                            String bootstrapIdentifier)
                     throws com.github.fungal.spi.deployers.DeployException
Start the resource adapter

Parameters:
resourceAdapter - The resource adapter
bootstrapIdentifier - The bootstrap context identifier; may be null
Throws:
com.github.fungal.spi.deployers.DeployException - Thrown if the resource adapter cant be started

associateResourceAdapter

protected void associateResourceAdapter(javax.resource.spi.ResourceAdapter resourceAdapter,
                                        Object object)
                                 throws com.github.fungal.spi.deployers.DeployException
Associate resource adapter with ojects if they implement ResourceAdapterAssociation

Parameters:
resourceAdapter - The resource adapter
object - The of possible association object
Throws:
com.github.fungal.spi.deployers.DeployException - Thrown if the resource adapter cant be started

initAndInject

protected Object initAndInject(String className,
                               List<? extends org.jboss.jca.common.api.metadata.ra.ConfigProperty> configs,
                               ClassLoader cl)
                        throws com.github.fungal.spi.deployers.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:
com.github.fungal.spi.deployers.DeployException - Thrown if the object cant be initialized

getUrls

protected URL[] getUrls(File directory)
                 throws MalformedURLException,
                        IOException
Get the URLs for the directory and all libraries located in the directory

Parameters:
directory - The directory
Returns:
The URLs
Throws:
MalformedURLException - MalformedURLException
IOException - IOException

bindConnectionFactory

protected String[] bindConnectionFactory(URL url,
                                         String deployment,
                                         Object cf)
                                  throws Throwable
Bind connection factory into JNDI

Parameters:
url - The deployment URL
deployment - The deployment name
cf - The connection factory
Returns:
The JNDI names bound
Throws:
Throwable - Thrown if an error occurs

bindConnectionFactory

protected String[] bindConnectionFactory(URL url,
                                         String deployment,
                                         Object cf,
                                         String jndi)
                                  throws Throwable
Bind connection factory into JNDI

Parameters:
url - The deployment URL
deployment - The deployment name
cf - The connection factory
jndi - The JNDI name
Returns:
The JNDI names bound
Throws:
Throwable - Thrown if an error occurs

findConnectionDefinition

protected org.jboss.jca.common.api.metadata.common.CommonConnDef findConnectionDefinition(String clz,
                                                                                          List<org.jboss.jca.common.api.metadata.common.CommonConnDef> defs)
Find the connection factory for a managed connection factory

Parameters:
clz - The fully quilified class name for the managed connection factory
defs - The connection definitions
Returns:
The connection definiton; null if none could be found

createPoolConfiguration

protected org.jboss.jca.core.connectionmanager.pool.api.PoolConfiguration createPoolConfiguration(org.jboss.jca.common.api.metadata.common.CommonPool pp,
                                                                                                  org.jboss.jca.common.api.metadata.common.CommonTimeOut tp,
                                                                                                  org.jboss.jca.common.api.metadata.common.CommonValidation vp)
Create an instance of the pool configuration based on the input

Parameters:
pp - The pool parameters
tp - The timeout parameters
vp - The validation parameters
Returns:
The configuration

start

public void start()
Start



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