geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r959134 - in /geronimo/server/trunk/plugins/connector-1_6: connector-deployer-1_6/pom.xml geronimo-connector-builder-1_6/pom.xml geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
Date Tue, 29 Jun 2010 22:48:27 GMT
Author: djencks
Date: Tue Jun 29 22:48:26 2010
New Revision: 959134

URL: http://svn.apache.org/viewvc?rev=959134&view=rev
Log:
GERONIMO-5414 try to make the dependency on corba to build corba resource-refs very optional

Modified:
    geronimo/server/trunk/plugins/connector-1_6/connector-deployer-1_6/pom.xml
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/pom.xml
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java

Modified: geronimo/server/trunk/plugins/connector-1_6/connector-deployer-1_6/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/connector-deployer-1_6/pom.xml?rev=959134&r1=959133&r2=959134&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/connector-deployer-1_6/pom.xml (original)
+++ geronimo/server/trunk/plugins/connector-1_6/connector-deployer-1_6/pom.xml Tue Jun 29
22:48:26 2010
@@ -117,43 +117,43 @@
                     </instructions>
                     <instance>
                         <plugin-artifact>
-                            <config-xml-content>
-                                <gbean name="ResourceRefBuilder">
-                                    <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
-                                    <attribute name="corbaEnvironment" propertyEditor="org.apache.geronimo.deployment.service.EnvironmentBuilder">
-                                        <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
-                                            <dependencies>
-                                                <dependency>
-                                                    <groupId>org.apache.geronimo.configs</groupId>
-                                                    <artifactId>j2ee-corba-yoko</artifactId>
-                                                    <version>${project.version}</version>
-                                                    <type>car</type>
-                                                </dependency>
-                                            </dependencies>
-                                        </environment>
-                                    </attribute>
-                                </gbean>
+                            <!--<config-xml-content>-->
+                                <!--<gbean name="ResourceRefBuilder">-->
+                                    <!--<attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>-->
+                                    <!--<attribute name="corbaEnvironment" propertyEditor="org.apache.geronimo.deployment.service.EnvironmentBuilder">-->
+                                        <!--<environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">-->
+                                            <!--<dependencies>-->
+                                                <!--<dependency>-->
+                                                    <!--<groupId>org.apache.geronimo.configs</groupId>-->
+                                                    <!--<artifactId>j2ee-corba-yoko</artifactId>-->
+                                                    <!--<version>${project.version}</version>-->
+                                                    <!--<type>car</type>-->
+                                                <!--</dependency>-->
+                                            <!--</dependencies>-->
+                                        <!--</environment>-->
+                                    <!--</attribute>-->
+                                <!--</gbean>-->
 
-                                <gbean name="AdminObjectRefBuilder">
-                                    <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
-                                </gbean>
+                                <!--<gbean name="AdminObjectRefBuilder">-->
+                                    <!--<attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>-->
+                                <!--</gbean>-->
 
-                                <gbean name="ClientResourceRefBuilder">
-                                    <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
-                                    <attribute name="corbaEnvironment" propertyEditor="org.apache.geronimo.deployment.service.EnvironmentBuilder">
-                                        <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
-                                            <dependencies>
-                                                <dependency>
-                                                    <groupId>org.apache.geronimo.configs</groupId>
-                                                    <artifactId>client-corba-yoko</artifactId>
-                                                    <version>${project.version}</version>
-                                                    <type>car</type>
-                                                </dependency>
-                                            </dependencies>
-                                        </environment>
-                                    </attribute>
-                                </gbean>
-                            </config-xml-content>
+                                <!--<gbean name="ClientResourceRefBuilder">-->
+                                    <!--<attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>-->
+                                    <!--<attribute name="corbaEnvironment" propertyEditor="org.apache.geronimo.deployment.service.EnvironmentBuilder">-->
+                                        <!--<environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">-->
+                                            <!--<dependencies>-->
+                                                <!--<dependency>-->
+                                                    <!--<groupId>org.apache.geronimo.configs</groupId>-->
+                                                    <!--<artifactId>client-corba-yoko</artifactId>-->
+                                                    <!--<version>${project.version}</version>-->
+                                                    <!--<type>car</type>-->
+                                                <!--</dependency>-->
+                                            <!--</dependencies>-->
+                                        <!--</environment>-->
+                                    <!--</attribute>-->
+                                <!--</gbean>-->
+                            <!--</config-xml-content>-->
                             <config-xml-content server="offline"/>
                             <copy-file dest-dir="schema">schema/schemaorg_apache_xmlbeans/src/</copy-file>
                         </plugin-artifact>

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/pom.xml?rev=959134&r1=959133&r2=959134&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/pom.xml (original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/pom.xml Tue
Jun 29 22:48:26 2010
@@ -41,9 +41,9 @@
         </dependency>
 
         <!--<dependency>-->
-            <!--<groupId>org.apache.geronimo.framework</groupId>-->
-            <!--<artifactId>geronimo-deploy-config</artifactId>-->
-            <!--<version>${project.version}</version>-->
+        <!--<groupId>org.apache.geronimo.framework</groupId>-->
+        <!--<artifactId>geronimo-deploy-config</artifactId>-->
+        <!--<version>${project.version}</version>-->
         <!--</dependency>-->
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
@@ -163,19 +163,20 @@
                     <instructions>
                         <!--packages containing "impl" or "internal" are excluded by default
-->
                         <Import-Package>
-                              org.apache.xmlbeans.impl.schema;version="2.4",
-                              org.apache.geronimo.deployment.xbeans.impl,
-                              org.apache.geronimo.deployment.javabean.xbeans.impl,
-                              org.apache.geronimo.deployment.xbeans,
-                              org.apache.geronimo.deployment.javabean.xbeans,
-                              org.apache.geronimo.deployment.dconfigbean,
-                              org.apache.geronimo.deployment.service,
-                              org.apache.geronimo.deployment.service.jsr88,
-                              org.apache.geronimo.xbeans.geronimo.naming,
-                              org.apache.geronimo.xbeans.geronimo.naming.impl,
-                              org.apache.geronimo.naming.deployment,
-                              org.apache.geronimo.naming.deployment.jsr88,
-                              *
+                            org.apache.xmlbeans.impl.schema;version="2.4",
+                            org.apache.geronimo.deployment.xbeans.impl,
+                            org.apache.geronimo.deployment.javabean.xbeans.impl,
+                            org.apache.geronimo.deployment.xbeans,
+                            org.apache.geronimo.deployment.javabean.xbeans,
+                            org.apache.geronimo.deployment.dconfigbean,
+                            org.apache.geronimo.deployment.service,
+                            org.apache.geronimo.deployment.service.jsr88,
+                            org.apache.geronimo.xbeans.geronimo.naming,
+                            org.apache.geronimo.xbeans.geronimo.naming.impl,
+                            org.apache.geronimo.naming.deployment,
+                            org.apache.geronimo.naming.deployment.jsr88,
+                            !org.omg.CORBA,
+                            *
                         </Import-Package>
                         <Export-Package>
                             org.apache.geronimo.connector.deployment,
@@ -185,7 +186,8 @@
                             org.apache.geronimo.xbeans.connector,
                             org.apache.geronimo.xbeans.connector.impl
                         </Export-Package>
-                        <DynamicImport-Package>schemaorg_apache_xmlbeans.*</DynamicImport-Package>
+                        <DynamicImport-Package>schemaorg_apache_xmlbeans.*,
+                            org.omg.CORBA</DynamicImport-Package>
                         <!--<_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>-->
                     </instructions>
                 </configuration>

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.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/connector/deployment/ResourceRefBuilder.java?rev=959134&r1=959133&r2=959134&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
(original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
Tue Jun 29 22:48:26 2010
@@ -41,6 +41,8 @@ import org.apache.geronimo.gbean.SingleE
 import org.apache.geronimo.gbean.annotation.GBean;
 import org.apache.geronimo.gbean.annotation.ParamAttribute;
 import org.apache.geronimo.gbean.annotation.ParamReference;
+import org.apache.geronimo.gbean.annotation.ParamSpecial;
+import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
 import org.apache.geronimo.j2ee.deployment.CorbaGBeanNameSource;
 import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.Module;
@@ -89,17 +91,20 @@ public class ResourceRefBuilder extends 
     private final QNameSet resourceRefQNameSet;
     private final Environment corbaEnvironment;
     private final SingleElementCollection<CorbaGBeanNameSource> corbaGBeanNameSourceCollection;
+    private final Bundle bundle;
 
     public ResourceRefBuilder(
             @ParamAttribute(name = "defaultEnvironment") Environment defaultEnvironment,
             @ParamAttribute(name = "corbaEnvironment") Environment corbaEnvironment,
             @ParamAttribute(name = "eeNamespaces") String[] eeNamespaces,
-            @ParamReference(name = "CorbaGBeanNameSource", namingType = "") Collection<CorbaGBeanNameSource>
corbaGBeanNameSourceCollection) {
+            @ParamReference(name = "CorbaGBeanNameSource", namingType = "") Collection<CorbaGBeanNameSource>
corbaGBeanNameSourceCollection,
+            @ParamSpecial(type = SpecialAttributeType.bundle) Bundle bundle) {
         super(defaultEnvironment);
 
         resourceRefQNameSet = buildQNameSet(eeNamespaces, "resource-ref");
         this.corbaEnvironment = corbaEnvironment;
         this.corbaGBeanNameSourceCollection = new SingleElementCollection<CorbaGBeanNameSource>(corbaGBeanNameSourceCollection);
+        this.bundle = bundle;
     }
 
     protected boolean willMergeEnvironment(JndiConsumer specDD, XmlObject plan) {
@@ -188,7 +193,7 @@ public class ResourceRefBuilder extends 
                 throw new DeploymentException("Could not convert " + url + " to URL", e);
             }
             return new URLReference(url);
-        } else if (ORB.class.isAssignableFrom(iface)) {
+        } else if (isOrbReference(iface)) {
             CorbaGBeanNameSource corbaGBeanNameSource = corbaGBeanNameSourceCollection.getElement();
             if (corbaGBeanNameSource == null) {
                 throw new DeploymentException("No orb setup but there is a orb reference");
@@ -248,6 +253,15 @@ public class ResourceRefBuilder extends 
         return null;
     }
 
+    private boolean isOrbReference(Class iface) {
+        try {
+            Class orbClass = bundle.loadClass("org.omg.CORBA.ORB");
+            return orbClass.isAssignableFrom(iface);
+        } catch (ClassNotFoundException e) {
+            return false;
+        }
+    }
+
     @Override
     public void setResourceEnvironment(ResourceEnvironmentBuilder builder, Collection<ResourceRef>
resourceRefList, GerResourceRefType[] gerResourceRefs) throws DeploymentException {
         Map refMap = mapResourceRefs(gerResourceRefs);



Mime
View raw message