[jboss-cvs] JBossAS SVN: r97855 - projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Dec 15 13:47:11 EST 2009
Author: jesper.pedersen
Date: 2009-12-15 13:47:10 -0500 (Tue, 15 Dec 2009)
New Revision: 97855
Modified:
projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/Annotations.java
Log:
[JBJCA-243] Support @ConnectionDefinitions
Modified: projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/Annotations.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/Annotations.java 2009-12-15 18:17:42 UTC (rev 97854)
+++ projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/Annotations.java 2009-12-15 18:47:10 UTC (rev 97855)
@@ -405,7 +405,7 @@
* @exception Exception Thrown if an error occurs
*/
private ConnectorMetaData processConnectionDefinitions(ConnectorMetaData md,
- AnnotationRepository annotationRepository)
+ AnnotationRepository annotationRepository)
throws Exception
{
Collection<Annotation> values = annotationRepository.getAnnotation(ConnectionDefinitions.class);
@@ -419,7 +419,7 @@
if (trace)
log.trace("Processing: " + c);
- md = attachConnectionDefinitions(md , c);
+ md = attachConnectionDefinitions(md , c, annotation.getClassName());
}
else
throw new DeployException("More than one @ConnectionDefinitions defined");
@@ -432,14 +432,25 @@
* Attach @ConnectionDefinitions
* @param md The metadata
* @param cds The connection definitions
+ * @param mcf The managed connection factory
* @return The updated metadata
* @exception Exception Thrown if an error occurs
*/
private ConnectorMetaData attachConnectionDefinitions(ConnectorMetaData md,
- ConnectionDefinitions cds)
+ ConnectionDefinitions cds,
+ String mcf)
throws Exception
{
createConDefs(md);
+
+ if (cds.value() != null)
+ {
+ for (ConnectionDefinition cd : cds.value())
+ {
+ md = attachConnectionDefinition(md, mcf, cd);
+ }
+ }
+
return md;
}
@@ -451,7 +462,7 @@
* @exception Exception Thrown if an error occurs
*/
private ConnectorMetaData processConnectionDefinition(ConnectorMetaData md,
- AnnotationRepository annotationRepository)
+ AnnotationRepository annotationRepository)
throws Exception
{
Collection<Annotation> values = annotationRepository.getAnnotation(ConnectionDefinition.class);
@@ -491,8 +502,30 @@
return md;
}
}
+
+ return attachConnectionDefinition(md, annotation.getClassName(), cd);
+ }
+
+ /**
+ * Attach @ConnectionDefinition
+ * @param md The metadata
+ * @param mcf The managed connection factory
+ * @param cd The connection definition
+ * @return The updated metadata
+ * @exception Exception Thrown if an error occurs
+ */
+ private ConnectorMetaData attachConnectionDefinition(ConnectorMetaData md,
+ String mcf,
+ ConnectionDefinition cd)
+ throws Exception
+ {
+ if (trace)
+ log.trace("Processing: " + cd);
+
+ createConDefs(md);
+
ConnectionDefinitionMetaData cdMeta = new ConnectionDefinitionMetaData();
- cdMeta.setManagedConnectionFactoryClass(annotation.getClassName());
+ cdMeta.setManagedConnectionFactoryClass(mcf);
cdMeta.setConnectionFactoryInterfaceClass(cd.connectionFactory().getName());
cdMeta.setConnectionFactoryImplementationClass(cd.connectionFactoryImpl().getName());
cdMeta.setConnectionInterfaceClass(cd.connection().getName());
More information about the jboss-cvs-commits
mailing list