geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmcma...@apache.org
Subject svn commit: r570429 - in /geronimo/plugins/system-database/trunk: ./ system-database-jetty/src/main/resources/META-INF/ system-database-portlets/src/main/java/org/apache/geronimo/console/internaldb/ system-database-tomcat/ system-database-tomcat/src/ma...
Date Tue, 28 Aug 2007 13:55:03 GMT
Author: pmcmahan
Date: Tue Aug 28 06:55:02 2007
New Revision: 570429

URL: http://svn.apache.org/viewvc?rev=570429&view=rev
Log:
GERONIMO-3413 system database plugin for tomcat.   fix gbean lookup in the admin portlet to
use the interface name instead of the gbean name, which is container-sensitive.

Added:
    geronimo/plugins/system-database/trunk/system-database-tomcat/
      - copied from r570301, geronimo/plugins/system-database/trunk/system-database-jetty/
Modified:
    geronimo/plugins/system-database/trunk/pom.xml
    geronimo/plugins/system-database/trunk/system-database-jetty/src/main/resources/META-INF/geronimo-plugin.xml
    geronimo/plugins/system-database/trunk/system-database-portlets/src/main/java/org/apache/geronimo/console/internaldb/DerbyConnectionUtil.java
    geronimo/plugins/system-database/trunk/system-database-tomcat/pom.xml
    geronimo/plugins/system-database/trunk/system-database-tomcat/src/main/resources/META-INF/geronimo-plugin.xml
    geronimo/plugins/system-database/trunk/system-database-tomcat/src/plan/plan.xml

Modified: geronimo/plugins/system-database/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/plugins/system-database/trunk/pom.xml?rev=570429&r1=570428&r2=570429&view=diff
==============================================================================
--- geronimo/plugins/system-database/trunk/pom.xml (original)
+++ geronimo/plugins/system-database/trunk/pom.xml Tue Aug 28 06:55:02 2007
@@ -371,9 +371,7 @@
             <modules>
                 <module>system-database-portlets</module>
                 <module>system-database-ear</module>
-<!--
                 <module>system-database-tomcat</module>
--->
                 <module>system-database-jetty</module>
             </modules>
         </profile>

Modified: geronimo/plugins/system-database/trunk/system-database-jetty/src/main/resources/META-INF/geronimo-plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/plugins/system-database/trunk/system-database-jetty/src/main/resources/META-INF/geronimo-plugin.xml?rev=570429&r1=570428&r2=570429&view=diff
==============================================================================
--- geronimo/plugins/system-database/trunk/system-database-jetty/src/main/resources/META-INF/geronimo-plugin.xml
(original)
+++ geronimo/plugins/system-database/trunk/system-database-jetty/src/main/resources/META-INF/geronimo-plugin.xml
Tue Aug 28 06:55:02 2007
@@ -32,6 +32,16 @@
     	<version>2.1-SNAPSHOT</version>
     </geronimo-versions>
     <prerequisite>
+        <id>org.apache.geronimo.configs/jetty6//car</id>
+        <resource-type>Web Container</resource-type>
+        <description>
+            This version of the plugin works with the Geronimo/Jetty distribution.
+            It is not intended to run in the Geronimo/Tomcat distribution.
+            There is a separate version of the plugin that works with Jetty.
+            Please install the version appropriate to your Geronimo distribution.
+        </description>
+    </prerequisite>
+    <prerequisite>
         <id>org.apache.geronimo.plugins/pluto-support/1.0-SNAPSHOT/car</id>
         <resource-type>Portlet Container</resource-type>
         <description>

Modified: geronimo/plugins/system-database/trunk/system-database-portlets/src/main/java/org/apache/geronimo/console/internaldb/DerbyConnectionUtil.java
URL: http://svn.apache.org/viewvc/geronimo/plugins/system-database/trunk/system-database-portlets/src/main/java/org/apache/geronimo/console/internaldb/DerbyConnectionUtil.java?rev=570429&r1=570428&r2=570429&view=diff
==============================================================================
--- geronimo/plugins/system-database/trunk/system-database-portlets/src/main/java/org/apache/geronimo/console/internaldb/DerbyConnectionUtil.java
(original)
+++ geronimo/plugins/system-database/trunk/system-database-portlets/src/main/java/org/apache/geronimo/console/internaldb/DerbyConnectionUtil.java
Tue Aug 28 06:55:02 2007
@@ -20,20 +20,17 @@
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.SQLException;
-import java.util.HashMap;
-import java.util.Iterator;
+import java.util.Set;
 
 import javax.sql.DataSource;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.derby.DerbySystemGBean;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.kernel.KernelRegistry;
-import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.kernel.repository.Version;
-
-import org.apache.geronimo.derby.DerbySystemGBean;
+import org.apache.geronimo.management.JCAManagedConnectionFactory;
 
 /**
  * A static class to handle retreiving connections. This class is built to
@@ -69,20 +66,19 @@
     static {
         try {
             log.debug("Looking up system datasource name...");
-            
-            // look up the system data source name without using the version number
-            HashMap props = new HashMap();
-            props.put("name","SystemDatasource");
-            props.put("j2eeType","JCAManagedConnectionFactory");
-            Artifact systemDB = new Artifact("org.apache.geronimo.plugins", "system-database-jetty",
(Version)null, "car");
-            AbstractNameQuery query = new AbstractNameQuery(systemDB,props);
-            Iterator iter = KernelRegistry.getSingleKernel().listGBeans(query).iterator();
-            
-            if (iter.hasNext()) {
-                SYSTEM_DATASOURCE_NAME = (AbstractName)iter.next();
-                log.debug("Using system datasource name: " + SYSTEM_DATASOURCE_NAME);
+
+            // cache the name for the system data source
+            AbstractNameQuery query = new AbstractNameQuery(JCAManagedConnectionFactory.class.getName());
+            Set<AbstractName> names = KernelRegistry.getSingleKernel().listGBeans(query);
+            for (AbstractName name : names) {
+                String nameProperty = name.getNameProperty("name");
+                if ("SystemDatasource".equals(nameProperty)) {
+                    SYSTEM_DATASOURCE_NAME = name;
+                    log.debug("Using system datasource name: " + SYSTEM_DATASOURCE_NAME);
+                }
             }
-            else {
+            
+            if (SYSTEM_DATASOURCE_NAME == null) {
                 log.warn("Failed to lookup system datasource name");
             }
         }

Modified: geronimo/plugins/system-database/trunk/system-database-tomcat/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/plugins/system-database/trunk/system-database-tomcat/pom.xml?rev=570429&r1=570301&r2=570429&view=diff
==============================================================================
--- geronimo/plugins/system-database/trunk/system-database-tomcat/pom.xml (original)
+++ geronimo/plugins/system-database/trunk/system-database-tomcat/pom.xml Tue Aug 28 06:55:02
2007
@@ -29,8 +29,8 @@
         <relativePath>../pom.xml</relativePath>
     </parent>
     
-    <artifactId>system-database-jetty</artifactId>
-    <name>Geronimo System Database :: Jetty Plugin</name>
+    <artifactId>system-database-tomcat</artifactId>
+    <name>Geronimo System Database :: Tomcat Plugin</name>
     <packaging>car</packaging>
     
     <dependencies>
@@ -111,7 +111,7 @@
                         <deploymentConfig>${gbeanDeployer}</deploymentConfig>
                         <deploymentConfig>${j2eeDeployer}</deploymentConfig>
                         <deploymentConfig>${connectorDeployer}</deploymentConfig>
-                        <deploymentConfig>${jetty6Deployer}</deploymentConfig>
+                        <deploymentConfig>${tomcatDeployer}</deploymentConfig>
                         <deploymentConfig>${jasperDeployer}</deploymentConfig>
                     </deploymentConfigs>
                     <module>

Modified: geronimo/plugins/system-database/trunk/system-database-tomcat/src/main/resources/META-INF/geronimo-plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/plugins/system-database/trunk/system-database-tomcat/src/main/resources/META-INF/geronimo-plugin.xml?rev=570429&r1=570301&r2=570429&view=diff
==============================================================================
--- geronimo/plugins/system-database/trunk/system-database-tomcat/src/main/resources/META-INF/geronimo-plugin.xml
(original)
+++ geronimo/plugins/system-database/trunk/system-database-tomcat/src/main/resources/META-INF/geronimo-plugin.xml
Tue Aug 28 06:55:02 2007
@@ -20,7 +20,7 @@
 
 <geronimo-plugin xmlns="http://geronimo.apache.org/xml/ns/plugins-1.2">
     <name>Geronimo System Database plugin</name>
-    <module-id>org.apache.geronimo.plugins/system-database-jetty/1.0-SNAPSHOT/car</module-id>
+    <module-id>org.apache.geronimo.plugins/system-database-tomcat/1.0-SNAPSHOT/car</module-id>
     <category>Geronimo</category>
     <description>
         System database plugin for geronimo.  This provides system databse together with
its dependencies as one dependency.
@@ -37,6 +37,16 @@
         <description>
             The pluto container configuration must be present in order for this
             plugin to register the web application context for its management portlets.
+        </description>
+    </prerequisite>
+    <prerequisite>
+        <id>org.apache.geronimo.configs/tomcat6//car</id>
+        <resource-type>Web Container</resource-type>
+        <description>
+            This version of the plugin works with the Geronimo/Tomcat distribution.
+            It is not intended to run in the Geronimo/Jetty distribution.
+            There is a separate version of the plugin that works with Jetty.
+            Please install the version appropriate to your Geronimo distribution.
         </description>
     </prerequisite>
     <dependency>org.apache.geronimo.configs/connector-deployer//car</dependency>

Modified: geronimo/plugins/system-database/trunk/system-database-tomcat/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/plugins/system-database/trunk/system-database-tomcat/src/plan/plan.xml?rev=570429&r1=570301&r2=570429&view=diff
==============================================================================
--- geronimo/plugins/system-database/trunk/system-database-tomcat/src/plan/plan.xml (original)
+++ geronimo/plugins/system-database/trunk/system-database-tomcat/src/plan/plan.xml Tue Aug
28 06:55:02 2007
@@ -22,7 +22,7 @@
 
     <module>
         <web>system-database-portlets.war</web>
-        <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.2" xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
+        <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.2" xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
             <dep:environment>
                 <dep:moduleId>
                     <dep:groupId>org.apache.geronimo.plugins</dep:groupId>
@@ -36,6 +36,7 @@
             </dep:environment>
             <context-root>/system-database</context-root>
             <security-realm-name>geronimo-admin</security-realm-name>
+            <cross-context/>
         </web-app>
     </module>
 



Mime
View raw message