geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r958398 - /geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java
Date Sun, 27 Jun 2010 17:26:09 GMT
Author: djencks
Date: Sun Jun 27 17:26:09 2010
New Revision: 958398

URL: http://svn.apache.org/viewvc?rev=958398&view=rev
Log:
use the classfinder from the module that knows what the relevant classes are when looking
for DataSource annotations

Modified:
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java?rev=958398&r1=958397&r2=958398&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java
(original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java
Sun Jun 27 17:26:09 2010
@@ -48,7 +48,6 @@ import org.apache.openejb.jee.IsolationL
 import org.apache.openejb.jee.JndiConsumer;
 import org.apache.openejb.jee.Property;
 import org.apache.openejb.jee.Text;
-import org.apache.xbean.finder.BundleAnnotationFinder;
 import org.apache.xmlbeans.QNameSet;
 import org.apache.xmlbeans.XmlObject;
 import org.osgi.framework.Bundle;
@@ -98,36 +97,29 @@ public class DataSourceBuilder extends A
     
     public void buildNaming(JndiConsumer specDD, XmlObject plan, Module module, Map componentContext)
throws DeploymentException {
                         
-        Bundle bundle = module.getEarContext().getDeploymentBundle();
-        
-        BundleAnnotationFinder classFinder;
-        try {
-            classFinder = new BundleAnnotationFinder(packageAdmin, bundle);
-        } catch (Exception e) {
-            throw new DeploymentException("could not create class finder " + bundle, e);
-        }
-        
-
         // step 1: process annotations and update deployment descriptor
-        List<Class> classes;        
-        classes = classFinder.findAnnotatedClasses(DataSourceDefinitions.class);
-        if (classes != null) {
-            for (Class clazz : classes) {
-                DataSourceDefinitions dsDefinitions = (DataSourceDefinitions) clazz.getAnnotation(DataSourceDefinitions.class);
-                for (DataSourceDefinition dsDefinition : dsDefinitions.value()) {
-                    processDefinition(dsDefinition, specDD);
+        if ((module != null) && (module.getClassFinder() != null)) {
+
+            List<Class> classes;        
+            classes = module.getClassFinder().findAnnotatedClasses(DataSourceDefinitions.class);
+            if (classes != null) {
+                for (Class clazz : classes) {
+                    DataSourceDefinitions dsDefinitions = (DataSourceDefinitions) clazz.getAnnotation(DataSourceDefinitions.class);
+                    for (DataSourceDefinition dsDefinition : dsDefinitions.value()) {
+                        processDefinition(dsDefinition, specDD);
+                    }
+
                 }
-                
             }
-        }
-        classes = classFinder.findAnnotatedClasses(DataSourceDefinition.class);
-        if (classes != null) {
-            for (Class clazz : classes) {
-                DataSourceDefinition dsDefinition = (DataSourceDefinition) clazz.getAnnotation(DataSourceDefinition.class);
-                processDefinition(dsDefinition, specDD);
+            classes = module.getClassFinder().findAnnotatedClasses(DataSourceDefinition.class);
+            if (classes != null) {
+                for (Class clazz : classes) {
+                    DataSourceDefinition dsDefinition = (DataSourceDefinition) clazz.getAnnotation(DataSourceDefinition.class);
+                    processDefinition(dsDefinition, specDD);
+                }
             }
         }
-        
+
         // step 2: bind all defined data sources into jndi
         Collection<DataSource> dataSources = specDD.getDataSource();
         if (dataSources != null) {



Mime
View raw message